Boost logo

Boost Users :

From: Joaquín M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2021-09-11 12:10:45


> Em 11 de set de 2021, à(s) 13:51, John Emmas via Boost-users <boost-users_at_[hidden]> escreveu:
> On 11/09/2021 12:11, Joaquin M López Muñoz via Boost-users wrote:
>>
>> So, you have two options:
>>
>> * Make sure that elements are removed from lists before being destroyed
>> * Activate auto-unlink mode for your lists
>
> Thanks Jaoquin - after reading that article it looked like I'd need to change all occurrences of:-
>
> public boost::intrusive::list_base_hook<>
>
> to be this:-
>
> public boost::intrusive::list_base_hook< boost::intrusive::link_mode<boost::intrusive::auto_unlink> >
>
> but after doing that, all compiles now trigger a new assert in 'boost/intrusive/list.hpp':-
>
> //Constant-time size is incompatible with auto-unlink hooks!
> BOOST_STATIC_ASSERT(!(constant_time_size &&
> ((int)value_traits::link_mode == (int)auto_unlink)
> ));
The comment above the assert says it all. Take a look at how constant_time_size<false> is used in the docs for auto-unlink hooks.

Joaquín M López Muñoz



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