Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Templates question




Am 24.02.2007 um 01:27 schrieb David Fang:

Another solution instead of this-> is to place the following
declaration in class bar's definition:
using foo<T>::SetUpRenderStates;

[...]


By qualifying the call to your_method(), (with "this->" or "base_class::"
you're telling the compiler to postpone the name lookup until template
*instantiation*. (Because a template-dependent base class can be
specialized with a completely different definition.) This is the idea
behind two-phase name lookup.

[...]

Visual C++ 2005 does not give an error for that code.

Not familiar with VC, but you might look for various options to enforce
standard conformance. For gcc, I recommend: -ansi -pedantic-errors.

The good news is that at least VC++ 2005 does not choke on the version

using base<T>::some_method;

(I can't comment on this-> some_method();, as IIRC I used the former version las year for some port from VC++ to OS X)

Regards,
	Tom_E
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >Re: Templates question (From: David Fang <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.