Em 11 de set de 2021, à(s) 13:51, John Emmas via Boost-users <boost-users@lists.boost.org> 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<falseis used in the docs for auto-unlink hooks. 

Joaquín M López Muñoz