Hello, I have some predefined type which inherits boost::noncopyable (so I have to store the pointer at these objects). I use a boost::ptr_map. As I know, the second argument in it is already a pointer. So, the code:
ptr_map<string, boost::any> SomeMap;
typedef %Some noncopyable class/signature% NewType;
// Inserting now
boost::any *temp = new boost::any(new KeyEvent());
SomeMap.insert("SomeKey", temp);
The error is:
error: no matching function for call to ‘boost::ptr_map<std::basic_string<char>, boost::any>::insert(const char [11], boost::any*&)’
UPD: When I don't pass the pointer to the any any temp = any(new KeyEvent());
I get:
error: no matching function for call to ‘boost::ptr_map<std::basic_string<char>, boost::any>::insert(const char [11], boost::any&)’