common_type_sfinae_test.cpp 865 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright Peter Dimov 2015
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt)
  5. #ifdef TEST_STD
  6. # include <type_traits>
  7. #else
  8. # include <boost/type_traits/common_type.hpp>
  9. #endif
  10. #include "test.hpp"
  11. #include "check_type.hpp"
  12. #include <iostream>
  13. struct X {};
  14. struct Y {};
  15. TT_TEST_BEGIN(common_type_sfinae)
  16. {
  17. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
  18. {
  19. tt::common_type<int, void*> tmp;
  20. (void)tmp;
  21. }
  22. {
  23. tt::common_type<X, Y> tmp;
  24. (void)tmp;
  25. }
  26. {
  27. tt::common_type<X&, int const*> tmp;
  28. (void)tmp;
  29. }
  30. {
  31. tt::common_type<X, Y, int, void*> tmp;
  32. (void)tmp;
  33. }
  34. #endif
  35. }
  36. TT_TEST_END