Hello, how can I insert my own class objects into ptr_map from boost. The objects are templated so I can't use some static typename in the map. So I did:
ptr_map<string, any> someMap;
My class inherits the boost::noncopyable.
someMap.insert("Test", new MyClass<SomeTemplate>());
The error is: error: no matching function for call to ‘boost::ptr_map
.
UPD: I'd prefer to make some wrapper and don't use the boost::any. So:
class IWrapper { };
class MyClass : public IWrapper { };
ptr_map<string, IWrapper> someMap;
someMap.insert("Test", new MyClass<SomeTemplate>());
Why it won't work (the same error)? I could pass the inherited class into parent interface. What's wrong?