views:

179

answers:

2

I occasionally run into this type of syntax when looking through open source code and was wondering what it's for, or what it's even called for that matter.

I have crawled the internet many a times before but simple contrived examples never had it nor explained it.

It looks like this

class SomeIdentifier ClassName { 
...
}

My question is what is SomeIdentifier ?

+2  A: 

You probably missed a ':' between SomeIdentifier and ClassName It might be like this:

class SomeIndentifier : ClassName{

};

Well, this means the class SomeIdentifier privately inheirits class ClassName! Google out 'Inheritance in C++' for more..

Srivatsan Iyer
Sorry I should of mentioned that it is not when a class is inheriting from a base class. That is why it is quite confusing me.
ReaLemon
Oops..! I misunderstood your question then..
Srivatsan Iyer
A good try, though I think Artyom is more on target...
Drew Hall
+6  A: 

Generally this would be something like that

#define SomeIdentifier __declspec(dllexport)

It is for support of MS dlls where you must specify explicitly every class that is used in interface.

And SomeIdentifier would be something like

FOO_BAR_EXPORT

Artyom
Yes that makes perfect sense in my context! Thanks
ReaLemon