Boost logo

Boost Users :

From: John Emmas (john_at_[hidden])
Date: 2021-09-11 13:59:35


On 11/09/2021 13:10, Joaquín M López Muñoz via Boost-users wrote:
>
>> Em 11 de set de 2021, à(s) 13:51, John Emmas via Boost-users
>> <boost-users_at_[hidden]> escreveu:
>>
>> 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.
>

Thanks again Joaquin - AFAICT the only occurrences of
'constant_time_size' are within libboost itself. In fact for 'class
list_impl' it seems to be defined as a constant:-

     static const bool constant_time_size = ConstantTimeSize;

However, I've realised that the problem I reported initially (today)
does seem to be connected to DLL linkage somehow. For example, this
code in a source file compiles okay:-

     #include <boost/intrusive/list.hpp>
     class Point : public boost::intrusive::list_base_hook<> {
     };

whereas this seemingly minor change:-

     #include <boost/intrusive/list.hpp>
     class __declspec(dllexport) Point : public
boost::intrusive::list_base_hook<> {
};

will immediately invoke this compile-time assertion:-
"BOOST_STATIC_ASSERT(( (int)hooktags::link_mode == (int)auto_unlink ));"
- i.e. the message I reported earlier...

So (presumably ?) 'boost::intrusive::list_base_hook<>' can't be used in
a class that'll get exported from a DLL?

John



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