1 | |
2 | // (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard |
3 | // Hinnant & John Maddock 2000. |
4 | // Use, modification and distribution are subject to the Boost Software License, |
5 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
6 | // http://www.boost.org/LICENSE_1_0.txt). |
7 | // |
8 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. |
9 | |
10 | |
11 | #ifndef BOOST_TT_REMOVE_CONST_HPP_INCLUDED |
12 | #define BOOST_TT_REMOVE_CONST_HPP_INCLUDED |
13 | |
14 | #include <boost/config.hpp> |
15 | #include <cstddef> // size_t |
16 | #include <boost/detail/workaround.hpp> |
17 | |
18 | namespace boost { |
19 | |
20 | // convert a type T to a non-cv-qualified type - remove_const<T> |
21 | template <class T> struct remove_const{ typedef T type; }; |
22 | template <class T> struct remove_const<T const>{ typedef T type; }; |
23 | |
24 | #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) |
25 | template <class T, std::size_t N> struct remove_const<T const[N]>{ typedef T type[N]; }; |
26 | #if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) |
27 | template <class T> struct remove_const<T const[]>{ typedef T type[]; }; |
28 | #endif |
29 | #endif |
30 | |
31 | #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) |
32 | |
33 | template <class T> using remove_const_t = typename remove_const<T>::type; |
34 | |
35 | #endif |
36 | |
37 | } // namespace boost |
38 | |
39 | #endif // BOOST_TT_REMOVE_CONST_HPP_INCLUDED |
40 | |