| Home | Libraries | People | FAQ | More

## Struct template derivation_value_traits

boost::intrusive::derivation_value_traits

## Synopsis

    // In header: <boost/intrusive/derivation_value_traits.hpp>

    template<typename T, typename NodeTraits, link_mode_type LinkMode = safe_link>
    struct derivation_value_traits {
      // types
      typedef NodeTraits                                                                    node_traits;
      typedef T                                                                             value_type;
      typedef node_traits::node                                                             node;
      typedef node_traits::node_ptr                                                         node_ptr;
      typedef node_traits::const_node_ptr                                                   const_node_ptr;
      typedef pointer_traits< node_ptr >::template rebind_pointer< value_type >::type       pointer;
      typedef pointer_traits< node_ptr >::template rebind_pointer< const value_type >::type const_pointer;
      typedef boost::intrusive::pointer_traits< pointer >::reference                        reference;
      typedef boost::intrusive::pointer_traits< const_pointer >::reference                  const_reference;

      // public static functions
      static node_ptr to_node_ptr(reference);
      static const_node_ptr to_node_ptr(const_reference);
      static pointer to_value_ptr(const node_ptr &);
      static const_pointer to_value_ptr(const const_node_ptr &);

      // public data members
      static const link_mode_type link_mode;
    };

## Description

This value traits template is used to create value traits from user defined node traits where value_traits::value_type will derive from node_traits::node

### `derivation_value_traits` public static functions

1.     static node_ptr to_node_ptr(reference value);

2.     static const_node_ptr to_node_ptr(const_reference value);

3.     static pointer to_value_ptr(const node_ptr & n);

4.     static const_pointer to_value_ptr(const const_node_ptr & n);