Templates question
Templates question
- Subject: Templates question
- From: Red Marble Games <email@hidden>
- Date: Thu, 22 Feb 2007 20:34:22 -0500
Where are good places to go for questions on C++ and templates?
Post 'em here 'cause I love 'em.
Well, OK, here's one, and I don't know if this is a C++ issue or an Xcode issue. It seems that if I derive a templated class from a templated class, then Xcode doesn't let me refer to inherited members of the parent class without a prefix. As a trivial (and very incomplete) example, just to illustrate:
template <class T> class foo { protected: OSStatus SetUpRenderStates(); };
template <class T> class bar : public foo<T> { public: OSStatus Render(){ SetUpRenderStates(); }; <<--NOPE };
In the example above, my "bar" class can't include a call to SetUpRenderStates; Xcode complains that there is no definition of that function. Instead, bar's Render() function must say "foo<T>::SetUpRenderStates();" to get a compile. I'm working on a port, and the code compiles fine without the prefix on the John Hodgman OS (and CodeWarrior also liked it fine on the Mac). Is there something to be done other than going through all the derived classes and adding all these prefixes?
Thanks,
Mark |
_______________________________________________
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