is_all_same.hpp 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright Oliver Kowalke 2017.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_FIBERS_DETAIL_IS_ALL_SAME_H
  6. #define BOOST_FIBERS_DETAIL_IS_ALL_SAME_H
  7. #include <type_traits>
  8. #include <boost/config.hpp>
  9. #include <boost/fiber/detail/config.hpp>
  10. #ifdef BOOST_HAS_ABI_HEADERS
  11. # include BOOST_ABI_PREFIX
  12. #endif
  13. namespace boost {
  14. namespace fibers {
  15. namespace detail {
  16. template< typename X, typename ... Y >
  17. struct is_all_same;
  18. template< typename X, typename Y0, typename ... Y >
  19. struct is_all_same< X, Y0, Y ... > {
  20. static constexpr bool value =
  21. std::is_same< X, Y0 >::value && is_all_same< X, Y ... >::value;
  22. };
  23. template< typename X, typename Y0 >
  24. struct is_all_same< X, Y0 > {
  25. static constexpr bool value = std::is_same< X, Y0 >::value;
  26. };
  27. }}}
  28. #ifdef BOOST_HAS_ABI_HEADERS
  29. # include BOOST_ABI_SUFFIX
  30. #endif
  31. #endif // BOOST_FIBERS_DETAIL_IS_ALL_SAME_H