Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/intrusive/detail/uncast.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga  2006-2014
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // See http://www.boost.org/libs/intrusive for documentation.
0010 //
0011 /////////////////////////////////////////////////////////////////////////////
0012 
0013 #ifndef BOOST_INTRUSIVE_DETAIL_UNCAST_HPP
0014 #define BOOST_INTRUSIVE_DETAIL_UNCAST_HPP
0015 
0016 #ifndef BOOST_CONFIG_HPP
0017 #  include <boost/config.hpp>
0018 #endif
0019 
0020 #if defined(BOOST_HAS_PRAGMA_ONCE)
0021 #  pragma once
0022 #endif
0023 
0024 #include <boost/intrusive/detail/config_begin.hpp>
0025 #include <boost/intrusive/pointer_traits.hpp>
0026 #include <boost/intrusive/detail/mpl.hpp>
0027 
0028 namespace boost {
0029 namespace intrusive {
0030 namespace detail {
0031 
0032 template<class ConstNodePtr>
0033 struct uncast_types
0034 {
0035    typedef typename pointer_traits<ConstNodePtr>::element_type element_type;
0036    typedef typename remove_const<element_type>::type           non_const_type;
0037    typedef typename pointer_traits<ConstNodePtr>::
0038       template rebind_pointer<non_const_type>::type            non_const_pointer;
0039    typedef pointer_traits<non_const_pointer>                   non_const_traits;
0040 };
0041 
0042 template<class ConstNodePtr>
0043 static typename uncast_types<ConstNodePtr>::non_const_pointer
0044    uncast(const ConstNodePtr & ptr)
0045 {
0046    return uncast_types<ConstNodePtr>::non_const_traits::const_cast_from(ptr);
0047 }
0048 
0049 } //namespace detail {
0050 } //namespace intrusive
0051 } //namespace boost
0052 
0053 #include <boost/intrusive/detail/config_end.hpp>
0054 
0055 #endif //BOOST_INTRUSIVE_DETAIL_UTILITIES_HPP