qualified_class_of.cpp 815 B

1234567891011121314151617181920212223242526272829303132
  1. /*<-
  2. Copyright (c) 2016 Barrett Adair
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. ->*/
  6. #include <boost/callable_traits/detail/config.hpp>
  7. #ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
  8. int main(){ return 0; }
  9. #else
  10. //[ qualified_class_of
  11. #include <type_traits>
  12. #include <boost/callable_traits/qualified_class_of.hpp>
  13. namespace ct = boost::callable_traits;
  14. struct foo;
  15. static_assert(std::is_same<foo &,
  16. ct::qualified_class_of_t<int(foo::*)()>>::value, "");
  17. static_assert(std::is_same<foo const &,
  18. ct::qualified_class_of_t<int(foo::*)() const>>::value, "");
  19. static_assert(std::is_same<foo volatile &&,
  20. ct::qualified_class_of_t<int(foo::*)() volatile &&>>::value, "");
  21. int main() {}
  22. //]
  23. #endif