• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C++ : "is not derived from type"..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >C++ : "is not derived from type".. (From: Dan Caugherty <email@hidden>)
 >Re: C++ : "is not derived from type".. (From: Steve Checkoway <email@hidden>)
 >Re: C++ : "is not derived from type".. (From: Dan Caugherty <email@hidden>)

  • Prev by Date: Re: C++ : "is not derived from type"..
  • Next by Date: Re: Codesense broken?
  • Previous by thread: Re: C++ : "is not derived from type"..
  • Next by thread: build log
  • Index(es):
    • Date
    • Thread