I am working on one of the project which requires
class MyObj;
map<string, MyObj*> myMap;
Here logic is here to map file name to MyObj class.
If I try to insert following
string strFilename = "MyFile";
MyObj* pObj = new MyObj();
myMap.insert(strFileName, pObj); // This line throwing following error.
no matching function for call to
'std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*> > >::insert(std::string&, void*)'
Can any one please help me how to solve this. Are is there better way we can do this using STL