2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
7 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
9 #ifndef BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED
10 #define BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED
12 #include <boost/config.hpp>
13 #include <boost/detail/workaround.hpp>
20 // We can't filter out rvalue_references at the same level as
21 // references or we get ambiguities from msvc:
24 struct remove_rvalue_ref
28 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
30 struct remove_rvalue_ref<T&&>
38 template <class T> struct remove_reference{ typedef typename boost::detail::remove_rvalue_ref<T>::type type; };
39 template <class T> struct remove_reference<T&>{ typedef T type; };
41 #if defined(BOOST_ILLEGAL_CV_REFERENCES)
42 // these are illegal specialisations; cv-qualifies applied to
43 // references have no effect according to [8.3.2p1],
44 // C++ Builder requires them though as it treats cv-qualified
45 // references as distinct types...
46 template <class T> struct remove_reference<T&const>{ typedef T type; };
47 template <class T> struct remove_reference<T&volatile>{ typedef T type; };
48 template <class T> struct remove_reference<T&const volatile>{ typedef T type; };
54 #endif // BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED