decltype.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (C) 2006 Arkadiy Vertleyb
  2. // Copyright (C) 2017 Daniela Engert
  3. // Use, modification and distribution is subject to the Boost Software
  4. // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED
  6. # define BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED
  7. #include <boost/type_traits/remove_cv.hpp>
  8. #include <boost/type_traits/remove_reference.hpp>
  9. namespace boost { namespace type_of {
  10. template<typename T>
  11. using remove_cv_ref_t = typename remove_cv<typename remove_reference<T>::type>::type;
  12. }}
  13. #define BOOST_TYPEOF(expr) boost::type_of::remove_cv_ref_t<decltype(expr)>
  14. #define BOOST_TYPEOF_TPL BOOST_TYPEOF
  15. #define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
  16. struct name {\
  17. typedef BOOST_TYPEOF_TPL(expr) type;\
  18. };
  19. #define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
  20. struct name {\
  21. typedef BOOST_TYPEOF(expr) type;\
  22. };
  23. #define BOOST_TYPEOF_REGISTER_TYPE(x)
  24. #define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
  25. #endif //BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED