Can anyone explain boost intrusive hooks concept? i don’t understand reading the documentation
http://www.boost.org/doc/libs/1_47_0/doc/html/intrusive.html
Can anyone explain boost intrusive hooks concept? i don’t understand reading the documentation http://www.boost.org/doc/libs/1_47_0/doc/html/intrusive.html
Share
Boost.intrusive forces you to provide information along the objects you want to store in an intrusive container.
Hooks are the way to provide the required information to the associated intrusive container. To do so, the class defining the objects you want to store can either inherit from the hook or own it as a member.
As long as the intrusive container needs to be fully known at compile time, hooks are parameterized using templates, which leads to a syntax where the option is a template class and the associated value is its parameter.
For instance, you can define the link mode by specifying the
link_modeparameter in the template parameters list and set its value:Last but not least, if your hook contains non-default values, you will have to pass it as a template parameter to the intrusive container class you use.
Considering intrusive list for example, this means replacing
by