Boost logo

Boost Users :

Subject: Re: [Boost-users] Acsess boost::intrusive::list inside a map
From: Dan Bloomquist (danb_at_[hidden])
Date: 2011-03-11 15:46:24


Ion Gaztañaga wrote:
>
> El 11/03/2011 20:19, Dan Bloomquist escribió:
>>
>> I would like to store lists inside a map value. I can:
>>
>> typedef /*boost::intrusive*/list< ClassBase > ClassList;
>
> You can't because intrusive containers are not copyable. They will be
> movable in the future once Boost.Move is integrated in trunk and
> ::boost::unordered_map accepts movable classes. Meanwhile perhaps you
> can use emplace to construct directly the value in the map, but I
> don't know if that will work.
>
Yes, thanks, now I see it is about instantiation. I can write
map_it->second.push_back( ... ) without error. But:
cmdMap.emplace( std::pair< Unit*, CommandList > ( ait->pUnit,
CommandList( ) ) );

gets me the same error:
C:\cpp\boost_1_42_0\boost/intrusive/list.hpp(1478) : error C2248:
'boost::intrusive::list_impl<Config>::list_impl' : cannot access private
member declared in class 'boost::intrusive::list_impl<Config>' ...

I'll see about doing this the smart pointer way.

Best, Dan.

> Ion
> _______________________________________________
> 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