Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:54:14

0001 
0002 // Copyright (C) 2009-2012 Lorenzo Caminiti
0003 // Distributed under the Boost Software License, Version 1.0
0004 // (see accompanying file LICENSE_1_0.txt or a copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 // Home at http://www.boost.org/libs/local_function
0007 
0008 #ifndef BOOST_LOCAL_FUNCTION_AUX_ADD_POINTED_CONST_HPP_
0009 #define BOOST_LOCAL_FUNCTION_AUX_ADD_POINTED_CONST_HPP_
0010 
0011 namespace boost { namespace local_function { namespace aux {
0012 
0013 // Metafunction to add const to pointed type `T` (i.e. converts
0014 // `T* [const]` to `T const* [const]`). `boost::add_const<>` cannot be used 
0015 // instead because only adds outer const.
0016 
0017 template<typename T> struct add_pointed_const { typedef T type; };
0018 
0019 template<typename T> struct add_pointed_const<T*> { typedef T const* type; };
0020 
0021 template<typename T> struct add_pointed_const<T const*>
0022     { typedef T const* type; };
0023 
0024 template<typename T> struct add_pointed_const<T* const>
0025     { typedef T const* const type; };
0026 
0027 template<typename T> struct add_pointed_const<T const* const>
0028     { typedef T const* const type; };
0029 
0030 } } } // namespace
0031 
0032 #endif //#include guard
0033