Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Struct template member_value_traits

boost::intrusive::member_value_traits

Synopsis

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

template<typename T, typename NodeTraits, 
         typename NodeTraits::node T::* PtrToMember, 
         link_mode_type LinkMode = safe_link> 
struct member_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 >                                          node_ptr_traits;
  typedef pointer_traits< node_ptr >::template rebind_pointer< T >::type      pointer;        
  typedef pointer_traits< node_ptr >::template rebind_pointer< constT >::type const_pointer;  
  typedef value_type &                                                        reference;      
  typedef const value_type &                                                  const_reference;

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

  // 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 store a node_traits::node

member_value_traits public static functions

  1. static node_ptr to_node_ptr(reference value) noexcept;
  2. static const_node_ptr to_node_ptr(const_reference value) noexcept;
  3. static pointer to_value_ptr(node_ptr n) noexcept;
  4. static const_pointer to_value_ptr(const_node_ptr n) noexcept;

PrevUpHomeNext