C
cpisztest
When I derive from this base class template, I get unresolved external symbol errors and I agree with the compiler. If it wasn't a template class, I'd define them in the .cpp and could do so because the types were known.
How do you handle this with templates?
I need one collection and mutex per class type that has derived from MyClass.
// MyClass.hxx
template<class Key, class T, class Cmp = std::less<Key> >
class MyClass
{
private:
static std::map<Key, T, Cmp> m_collection;
static boost::mutex m_mutex;
};
How do you handle this with templates?
I need one collection and mutex per class type that has derived from MyClass.
// MyClass.hxx
template<class Key, class T, class Cmp = std::less<Key> >
class MyClass
{
private:
static std::map<Key, T, Cmp> m_collection;
static boost::mutex m_mutex;
};