What does "TAG" in [class TAG MyClass {...};] mean?

R

ramiro_b

Folks,

Any pointers on what is the meaning of the tags (SOME_TAG, and
RTI_EXPORT) preceeding the class names in the following examples?

class SOME_TAG MyClass
{
// ...
};

class RTI_EXPORT exception
{
// ...
};

I have seen this kind of thing a few times. Is this a class declaration
allowed by the C++ standard? What is it used for?

Thank you!

-Bossanovaplayer
 
V

Victor Bazarov

Any pointers on what is the meaning of the tags (SOME_TAG, and
RTI_EXPORT) preceeding the class names in the following examples?

class SOME_TAG MyClass
{
// ...
};

class RTI_EXPORT exception
{
// ...
};

I have seen this kind of thing a few times. Is this a class
declaration allowed by the C++ standard? What is it used for?

If I define SOME_TAG like this:

#define SOME_TAG

then the code when compiled has no tag whatsoever, it is eliminated
by the preprocessor, and the code is perfectly fine. Now, if the
macro is defined to expand into something else, then you need to ask
about it in a newsgroup for your compiler, it is most likely very
compiler- or/and platform-specific.

V
 
R

ramiro_b

Victor,

Thanks for your input. I've tried it and it does compile. From this
point on it's like you said, different applications will expand it into
something that makes sense for them. As for myself, it's good enough
that now I know how it would compile.

Regards,

-Ramiro
 

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
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top