is_nothrow_eq_comparable.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright 2016-2017 Joaquin M Lopez Munoz.
  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. *
  6. * See http://www.boost.org/libs/poly_collection for library home page.
  7. */
  8. #ifndef BOOST_POLY_COLLECTION_DETAIL_IS_NOTHROW_EQ_COMPARABLE_HPP
  9. #define BOOST_POLY_COLLECTION_DETAIL_IS_NOTHROW_EQ_COMPARABLE_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/poly_collection/detail/is_equality_comparable.hpp>
  14. #include <type_traits>
  15. #include <utility>
  16. namespace boost{
  17. namespace poly_collection{
  18. namespace detail{
  19. template<typename T,typename=void>
  20. struct is_nothrow_equality_comparable:std::false_type{};
  21. template<typename T>
  22. struct is_nothrow_equality_comparable<
  23. T,
  24. typename std::enable_if<
  25. is_equality_comparable<T>::value
  26. >::type
  27. >:std::integral_constant<
  28. bool,
  29. noexcept(std::declval<T>()==std::declval<T>())
  30. >{};
  31. } /* namespace poly_collection::detail */
  32. } /* namespace poly_collection */
  33. } /* namespace boost */
  34. #endif