STL map with Boost shared_ptr
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I'm trying to store boost::shared_ptrs in a std::map with a const std::string as the key. The trouble arises when I need to find a value. Using find() yields an iterator, but VC2003 doesn't like it: error C2440: 'initializing' : cannot convert from 'std::allocator<_Ty>::value_type' to 'boost::shared_ptr' with [ _Ty=std::pair> ] and [ T=Sprite ] And here's the bit of code that causes this reaction: map >::iterator frameSet = mysprite.find("animationName"); What I had hoped was that frameSet would be an iterator that I could dereference to call member functions on the Sprite object. But, alas. Anyone have any suggestions? :wtf: tentons