On 17/10/2015 18:04, Oliver Kowalke wrote:
I'd like to determine the hook type of an intrusive container (intrusive::list):
template< typename List > void do_link( List & lst) { static_assert(std::is_same< typename List::???, my_hook_type >::value); lst.push_back( * this); }
Hi,
There is no current typedef for that. The closest thing is
"value_traits", which is what the container understands. Each hook type
is transformed to "value_traits" which tells the container how the value
and the node (stored in the hook) communicate.
If "value_traits" option is passed instead of a hook, then
container::value_traits is the same type. If a hook is passed (or
deduced, if the default hook is used), then that information is
transformed in a "value_traits" defined here:
boost/intrusive/hook_traits.hpp
(e.g. boost::intrusive::detail::bhtraits