add_reference.hpp 798 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. Copyright 2019 Glen Joseph Fernandes
  3. ([email protected])
  4. Distributed under the Boost Software License, Version 1.0.
  5. (http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #ifndef BOOST_ALIGN_DETAIL_ADD_REFERENCE_HPP
  8. #define BOOST_ALIGN_DETAIL_ADD_REFERENCE_HPP
  9. #include <boost/config.hpp>
  10. #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
  11. #include <type_traits>
  12. #endif
  13. namespace boost {
  14. namespace alignment {
  15. namespace detail {
  16. #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
  17. using std::add_lvalue_reference;
  18. #else
  19. template<class T>
  20. struct add_lvalue_reference {
  21. typedef T& type;
  22. };
  23. template<>
  24. struct add_lvalue_reference<void> {
  25. typedef void type;
  26. };
  27. template<>
  28. struct add_lvalue_reference<const void> {
  29. typedef const void type;
  30. };
  31. #endif
  32. } /* detail */
  33. } /* alignment */
  34. } /* boost */
  35. #endif