Re: Templates question
Re: Templates question
- Subject: Re: Templates question
- From: Thomas Engelmeier <email@hidden>
- Date: Mon, 26 Feb 2007 16:20:42 +0100
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:
This email sent to email@hidden