1 #ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
2 #define BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
5 // Copyright 2015 Peter Dimov
7 // Distributed under the Boost Software License, Version 1.0.
8 // See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt
12 #include <boost/type_traits/is_const.hpp>
13 #include <boost/type_traits/is_volatile.hpp>
14 #include <boost/type_traits/add_const.hpp>
15 #include <boost/type_traits/add_volatile.hpp>
16 #include <boost/type_traits/conditional.hpp>
21 template<class T, class U> struct copy_cv
25 typedef typename boost::conditional<boost::is_const<U>::value, typename boost::add_const<T>::type, T>::type CT;
29 typedef typename boost::conditional<boost::is_volatile<U>::value, typename boost::add_volatile<CT>::type, CT>::type type;
34 #endif // #ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED