A
avasilev
Hi all, and Happy new Year!
I have the following class method:
class MyClass
{
public:
static const char* typeName() { return "myClass";}
};
The pointer that this method returns serves as an unique identifier of
the class. Thus, it must not only point to the class name string, but
also the value of the pointer itself serfes as an UID.
My question is: Since this method is defined inside the class
declaration, in a header file, is it guaranteed that the same
'version' of the method will be called in all compilation units in my
application, and any call to the method will return exactly the same
pointer, or will there be different 'copies' of the method and string
literal in each compilation unit, and they will return a different
char* ?
Thanks in advance
Alex
I have the following class method:
class MyClass
{
public:
static const char* typeName() { return "myClass";}
};
The pointer that this method returns serves as an unique identifier of
the class. Thus, it must not only point to the class name string, but
also the value of the pointer itself serfes as an UID.
My question is: Since this method is defined inside the class
declaration, in a header file, is it guaranteed that the same
'version' of the method will be called in all compilation units in my
application, and any call to the method will return exactly the same
pointer, or will there be different 'copies' of the method and string
literal in each compilation unit, and they will return a different
char* ?
Thanks in advance
Alex