Boost logo

Boost Users :

Subject: Re: [Boost-users] storing pointers in a std::map
From: Alan Tennant (alan2here_at_[hidden])
Date: 2010-03-12 11:13:39


Thanks. I presume it would be better in implementing a map that can hold
left = std::string, right = "any" but only pointers to objects to have a
boost::map_ptr<std::string> than a std::map<std::string, boost::any>.

On 11 March 2010 21:06, Thorsten Ottosen <thorsten.ottosen_at_[hidden]>wrote:

> Alan Tennant skrev:
>
> Thanks guys. I'm embarrassed to say that it was the #include <string>
>> problem.
>>
>
> use
>
> boost::ptr_map<std::string,int>
>
> or
>
> std::map<std::string,boost::shared_ptr<int>>
>
> to manange the memory, if you need that.
>
> -Thorsten
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net