Chris@16: ///////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // (C) Copyright Ion Gaztanaga 2006-2013 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/intrusive for documentation. Chris@16: // Chris@16: ///////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: #ifndef BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP Chris@16: #define BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP Chris@16: Chris@101: #include Chris@101: #include Chris@16: #include Chris@16: #include Chris@16: Chris@101: #if defined(BOOST_HAS_PRAGMA_ONCE) Chris@101: # pragma once Chris@101: #endif Chris@101: Chris@16: namespace boost { Chris@16: namespace intrusive { Chris@16: Chris@16: //!This value traits template is used to create value traits Chris@16: //!from user defined node traits where value_traits::value_type and Chris@16: //!node_traits::node should be equal Chris@101: template Chris@16: struct trivial_value_traits Chris@16: { Chris@16: typedef NodeTraits node_traits; Chris@16: typedef typename node_traits::node_ptr node_ptr; Chris@16: typedef typename node_traits::const_node_ptr const_node_ptr; Chris@16: typedef typename node_traits::node value_type; Chris@16: typedef node_ptr pointer; Chris@16: typedef const_node_ptr const_pointer; Chris@16: static const link_mode_type link_mode = LinkMode; Chris@16: static node_ptr to_node_ptr (value_type &value) Chris@16: { return pointer_traits::pointer_to(value); } Chris@16: static const_node_ptr to_node_ptr (const value_type &value) Chris@16: { return pointer_traits::pointer_to(value); } Chris@16: static const pointer & to_value_ptr(const node_ptr &n) { return n; } Chris@16: static const const_pointer &to_value_ptr(const const_node_ptr &n) { return n; } Chris@16: }; Chris@16: Chris@16: } //namespace intrusive Chris@16: } //namespace boost Chris@16: Chris@101: #include Chris@101: Chris@16: #endif //BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP