2 Copyright 2019 Glen Joseph Fernandes
5 Distributed under the Boost Software License,
6 Version 1.0. (See accompanying file LICENSE_1_0.txt
7 or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_TT_COPY_REFERENCE_HPP_INCLUDED
10 #define BOOST_TT_COPY_REFERENCE_HPP_INCLUDED
12 #include <boost/type_traits/add_lvalue_reference.hpp>
13 #include <boost/type_traits/add_rvalue_reference.hpp>
14 #include <boost/type_traits/is_lvalue_reference.hpp>
15 #include <boost/type_traits/is_rvalue_reference.hpp>
16 #include <boost/type_traits/conditional.hpp>
20 template<class T, class U>
21 struct copy_reference {
22 typedef typename conditional<is_rvalue_reference<U>::value,
23 typename add_rvalue_reference<T>::type,
24 typename conditional<is_lvalue_reference<U>::value,
25 typename add_lvalue_reference<T>::type, T>::type>::type type;
28 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
29 template<class T, class U>
30 using copy_reference_t = typename copy_reference<T, U>::type;