remove_noexcept.cpp 924 B

123456789101112131415161718192021222324252627282930313233343536
  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. #include "test.hpp"
  8. #include <boost/callable_traits/remove_noexcept.hpp>
  9. template<typename Noexcept, typename NotNoexcept>
  10. void test() {
  11. CT_ASSERT(std::is_same<NotNoexcept, TRAIT(remove_noexcept, Noexcept)>::value);
  12. }
  13. #define TEST_NOEXCEPT(not_noexcept) \
  14. test<not_noexcept BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER, not_noexcept>()
  15. int main() {
  16. TEST_NOEXCEPT(int(int) LREF);
  17. TEST_NOEXCEPT(int(*)(int));
  18. TEST_NOEXCEPT(int(int, ...) RREF);
  19. TEST_NOEXCEPT(int(*)(int, ...));
  20. struct foo;
  21. TEST_NOEXCEPT(int(foo::*)(int));
  22. TEST_NOEXCEPT(int(foo::*)(int) const);
  23. TEST_NOEXCEPT(int(foo::*)(int, ...));
  24. TEST_NOEXCEPT(int(foo::*)(int, ...) volatile);
  25. }