decltype.hpp 983 B

123456789101112131415161718192021222324252627282930313233
  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 <type_traits>
  8. namespace boost { namespace type_of {
  9. template<typename T>
  10. using remove_cv_ref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
  11. }}
  12. #define BOOST_TYPEOF(expr) boost::type_of::remove_cv_ref_t<decltype(expr)>
  13. #define BOOST_TYPEOF_TPL BOOST_TYPEOF
  14. #define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
  15. struct name {\
  16. typedef BOOST_TYPEOF_TPL(expr) type;\
  17. };
  18. #define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
  19. struct name {\
  20. typedef BOOST_TYPEOF(expr) type;\
  21. };
  22. #define BOOST_TYPEOF_REGISTER_TYPE(x)
  23. #define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
  24. #endif //BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED