Topic: C++ Language Extensions (newbie question)
Author: jthill@us.oracle.com (Jim Hill)
Date: 26 Jun 93 00:08:10 GMT Raw View
Isn't the external linkage for class/struct names a byproduct of name
mangling? If I understand this right, you'd have to define all functions
that accept or return any derivative of the type (S, *S, S&, whatever) static
as well, or risk duplicate names:
static struct S writes:
{
int a;
};
void
Stinky(const S& tinky) // boom.
{
}
I think the restrictions on the use of the typename would be much more
stringent than in C -- still incompatible, only this way it's also that
much more complicated. "Any .cc file big enough to need its own private
types is probably big enough to need naming conventions"?
Huh. You could get the same effect with
class myccpgm
{
class A { /* ... */ };
//...
}
hah! at last, a use for #define!
#define my(class,mem) myccpgm::##class##::mem
or just use abbrev_mode ;,
Then again, I could be completely out in space somewhere. If so, please
correct me? I'm still trying to get a handle on this language.
Jim
--
jthill@us.oracle.com