Re: C++ : "is not derived from type"..
Re: C++ : "is not derived from type"..
- Subject: Re: C++ : "is not derived from type"..
- From: David Rowland <email@hidden>
- Date: Wed, 21 Oct 2009 08:11:12 -0700
On Oct 21, 2009, at 6:16 AM, Dan Caugherty wrote:
Thanks Steve!
But oh that's just not annoying, it's weird. It seems to me that the
compiler is recognizing the linkage<> type in the global namespace (as
it was defined just a few short lines earlier), but it still needs the
containing class to hoodwink it with the typename keyword.
I will most definitely want to read the rationale for this. Anyone
else know where I can find a suitable explanation?
"typename" is required in the latest C++ to tell the compiler right
there that the thing is the name of a type. As a derived name, it
could be something else, depending on the template argument. That
would be detected, but later. The gurus (of whom I am not one)
evidently decided that avoiding the ambiguity was important to do very
early.
It is defined in the C++ standard (2003) in section 14.6. The best
explanation is in "C++ Templates -- The Complete Guide" by Vandevoorde
and Josuttis, page 43 and page 130.
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden