|
|
|||
File indexing completed on 2025-12-16 10:10:24
0001 0002 // (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard 0003 // Hinnant & John Maddock 2000. 0004 // Use, modification and distribution are subject to the Boost Software License, 0005 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 0006 // http://www.boost.org/LICENSE_1_0.txt). 0007 // 0008 // See http://www.boost.org/libs/type_traits for most recent version including documentation. 0009 0010 #ifndef BOOST_TT_ADD_CONST_HPP_INCLUDED 0011 #define BOOST_TT_ADD_CONST_HPP_INCLUDED 0012 0013 #include <boost/type_traits/detail/config.hpp> 0014 0015 namespace boost { 0016 0017 // * convert a type T to const type - add_const<T> 0018 // this is not required since the result is always 0019 // the same as "T const", but it does suppress warnings 0020 // from some compilers: 0021 0022 #if defined(BOOST_MSVC) 0023 // This bogus warning will appear when add_const is applied to a 0024 // const volatile reference because we can't detect const volatile 0025 // references with MSVC6. 0026 # pragma warning(push) 0027 # pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored 0028 #endif 0029 0030 template <class T> struct add_const 0031 { 0032 typedef T const type; 0033 }; 0034 0035 #if defined(BOOST_MSVC) 0036 # pragma warning(pop) 0037 #endif 0038 0039 template <class T> struct add_const<T&> 0040 { 0041 typedef T& type; 0042 }; 0043 0044 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) 0045 0046 template <class T> using add_const_t = typename add_const<T>::type; 0047 0048 #endif 0049 0050 } // namespace boost 0051 0052 #endif // BOOST_TT_ADD_CONST_HPP_INCLUDED
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|