• 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: Problems since migrating to xcode 2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems since migrating to xcode 2


  • Subject: Re: Problems since migrating to xcode 2
  • From: Chris Espinosa <email@hidden>
  • Date: Wed, 25 May 2005 21:03:35 -0700

This is almost FAQ #! for gcc 4.0 for C++ users and is covered in some detail in the gcc 4.0 Release Notes:

file:///Developer/ADC Reference Library/releasenotes/DeveloperTools/GCC4.html

What you're looking for is this:

GCC 4.0 now implements "two-phase name lookup" correctly. This has the following consequences:

  • Within a template, you have to use the the typename keyword when a nested type depends on a template parameter. For example, if T is a template parameter, you have to write typename list<T>::iterator, not just list<T>::iterator. Without the typename, the compiler will parse this under the assumption that the name iterator doesn't refer to a type. (See section 14.6 of the C++ standard for more details.)
  • Names that do not depend on a template parameter are looked up at the point of template definition, not the point of instantiation. Within a template, for example, f(3) means whatever overload of f best matches an int argument at the point where the template is defined. If there is no appropriate version of f in scope then this is an error, even if such a function is declared later on.
  • If a class template inherits from another class template, then base class members won't be found unless they are qualified. (See section 14.6.2, paragraph 3, of the C++ standard.) For example:
  •     template <typename T> struct Base {
  •       void f();
  •     };
  •     template <typename T> struct Derived : public Base<T> {
  •       void g() {
  •         f();          // Error, name not found.
  •         this->f();    // OK
  •         Derived::f(); // OK
  •         Base<T>::f(); // OK
  •       }
  •     };


 _______________________________________________
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: 
 >Problems since migrating to xcode 2 (From: Simon Harms <email@hidden>)

  • Prev by Date: Re: C++ template pointers vs. objects
  • Next by Date: Re: File saving problem.
  • Previous by thread: Problems since migrating to xcode 2
  • Next by thread: Re: Xcode-users Digest, Vol 2, Issue 224
  • Index(es):
    • Date
    • Thread