add_lvalue_reference.hpp 768 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2010 John Maddock
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // See http://www.boost.org/LICENSE_1_0.txt
  4. #ifndef BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP
  5. #define BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP
  6. #include <boost/type_traits/add_reference.hpp>
  7. namespace boost{
  8. template <class T> struct add_lvalue_reference
  9. {
  10. typedef typename boost::add_reference<T>::type type;
  11. };
  12. #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
  13. template <class T> struct add_lvalue_reference<T&&>
  14. {
  15. typedef T& type;
  16. };
  17. #endif
  18. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
  19. template <class T> using add_lvalue_reference_t = typename add_lvalue_reference<T>::type;
  20. #endif
  21. }
  22. #endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP