public keyword usage in managed c++

C

CeZaR

I have this line:

__gc public class WindowsMain : public Form {
.....

What does the first public keyword?
I can't find anything about that in the docs.

Thanks!
 
R

Ron Natalie

CeZaR said:
I have this line:

__gc public class WindowsMain : public Form {
....

What does the first public keyword?
I can't find anything about that in the docs.
Doesn't look legal in C++. You'll have to go ask in a .NET
group if you want to know about Microsoft's abuse of the language.
 
I

Ioannis Vranos

CeZaR said:
I have this line:

__gc public class WindowsMain : public Form {
....

What does the first public keyword?
I can't find anything about that in the docs.


In the current C++/CLI draft standard which will replace and extend the
current "managed extensions", it is mentioned:



"The use of public in this context indicates that the type will be
visible outside the assembly. Conversely, the private indicates that the
type will not be visible outside the assembly. The default visibility
for a type is private."






Regards,

Ioannis Vranos

http://www23.brinkster.com/noicys
 
J

Jack Klein

In the current C++/CLI draft standard which will replace and extend the
current "managed extensions", it is mentioned:

Please keep your off-topic garbage out of this newsgroup. The ONLY
standards that are relevant here are ISO 14882 and such of ISO 9998 as
happens to be included by reference in 14882.

Whatever draft standard you are talking about does not, and will not,
change so much as a comma of the standards that matter here.

There is no such thing as "managed" C++ in this group.
 
I

Ioannis Vranos

Jack said:
Please keep your off-topic garbage out of this newsgroup. The ONLY
standards that are relevant here are ISO 14882 and such of ISO 9998 as
happens to be included by reference in 14882.

Whatever draft standard you are talking about does not, and will not,
change so much as a comma of the standards that matter here.

There is no such thing as "managed" C++ in this group.


However C++/CLI standard is a standard concerning C++, so it is on topic
here. And code in C++/CLI is portable to all CLI VMs in all OSes.






Regards,

Ioannis Vranos

http://www23.brinkster.com/noicys
 
P

Pete

Ioannis said:
However C++/CLI standard is a standard concerning C++, so it is on topic
here. And code in C++/CLI is portable to all CLI VMs in all OSes.

That's like saying that code specific to a deriving class is "on-topic"
inside a base class. It's clearly not.
 
D

Denis Remezov

Ioannis said:
However C++/CLI standard is a standard concerning C++, so it is on topic
here. And code in C++/CLI is portable to all CLI VMs in all OSes.

C++/CLI is NOT C++. The fact that it is a draft or a standard is
completely irrelevant, as well as its portability.

Trolltech's syntactic extensions concern themselves with C++, so should
I start discussing their QT library here? How about POSIX, multithreading
libraries, RPC (of your choice), CORBA C++ bindings, compiler extensions,
build tools? C++/CLI is less interesting to me, and has no more standard
C++ content than the above.

Please stop posting about C++/CLI in this group.

Denis
 
N

Nemanja Trifunovic

What does the first public keyword?
I can't find anything about that in the docs.

From Managed Extensions for C++ Language Specification:

4. __gc Classes

http://msdn.microsoft.com/library/d...mxspec/html/vcmanagedextensionsspec_start.asp

"By default, a __gc class is not visible outside its assembly. To make
a __gc class visible outside its assembly, use the public access
modifier (public __gc MyClass)."

And from
21.1. Class Visibility

http://msdn.microsoft.com/library/d...cmxspec/html/vcmanagedextensionsspec_21_1.asp

"The public class-visibility-specifier indicates that a class will be
visible to any source files that contain a #using directive for its
containing assembly. Conversely, the private
class-visibility-specifier indicates that a type will not be visible
to any source files that contain a #using directive for its containing
assembly. However, private types are visible within the same assembly.
The default visibility for a class is private."

Hope it helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top