| Home | Libraries | People | FAQ | More

## Binary search tree hooks: bs_set_base_hook and bs_set_member_hook

Binary search tree hooks can be used with several tree-like containers that don't need any additional metadata for rebalancing operations. This has many advantages since binary search tree hooks can also be used to insert values in plain binary search tree, splay tree, scapegoat tree, and treap containers.

    template <class ...Options>
    class bs_set_base_hook;

- `bs_set_base_hook`: the user class derives publicly from this class to make it compatible with the mentioned tree based containers.

    template <class ...Options>
    class bs_set_member_hook;

- `bs_set_member_hook`: the user class contains a public member of this class to make it compatible with the mentioned tree based containers.

`bs_set_base_hook` and `bs_set_member_hook` receive the same options explained in the section How to use Boost.Intrusive:

- `tag<class Tag>` (for base hooks only): This argument serves as a tag, so you can derive from more than one base hook. Default: `tag<default_tag>`.
- `link_mode<link_mode_type LinkMode>`: The linking policy. Default: `link_mode<safe_link>`.
- `void_pointer<class VoidPointer>`: The pointer type to be used internally in the hook and propagated to the container. Default: `void_pointer<void*>`.