Skip to main content
gamedev.net
🔒 Locked

Templated issues...

Started by nife 1 reply 1.2k views
Original Post
nife
nife
Hi, I'm looking for a solution to this: template class Ptr { public: typedef boost::shared_ptr Shared; }; typedef unsigned int Hash; template class CYNA_API AssetManager { public: typedef std::map::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 std::map' error: expected a type, got Ptr::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...
Killers don't end up in jailThey end up on a high-score!
Nitage
Nitage
I'm pretty sure that using typename is the correct solution.

Have you tried:

typedef std::maptypename Ptr::Shared> AssetMap;
nife
nife
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
Killers don't end up in jailThey end up on a high-score!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.