Sign in to follow this  
nife

Templated issues...

Recommended Posts

Hi, I'm looking for a solution to this: template<class T> class Ptr { public: typedef boost::shared_ptr<T> Shared; }; typedef unsigned int Hash; template<class T> class CYNA_API AssetManager { public: typedef std::map<Hash, Ptr<T>::Shared> AssetMap; }; Because the AssetManager gives me the following errors (with GCC 3.4.4) error: type/value mismatch at argument 2 in template parameter list for `template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' error: expected a type, got ` Ptr<T>::Shared' error: template argument 4 is invalid error: ISO C++ forbids declaration of `AssetMap' with no type I've tried to typename the templates and a couple of other hacks/tips I found on the net, but no luck with either of them, unfortunately :( Thanks in advance...

Share this post


Link to post
Share on other sites
LOL, I know what I did wrong when I looked at your answer.
I placed the typename right before the T instead of in front of the class.

But anyways, thank you very much, it made the whole thing possible :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this