is_applicable_property.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // is_applicable_property.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_IS_APPLICABLE_PROPERTY_HPP
  11. #define ASIO_IS_APPLICABLE_PROPERTY_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include "asio/detail/type_traits.hpp"
  17. namespace asio {
  18. namespace detail {
  19. template <typename T, typename Property, typename = void>
  20. struct is_applicable_property_trait : false_type
  21. {
  22. };
  23. #if defined(ASIO_HAS_VARIABLE_TEMPLATES)
  24. template <typename T, typename Property>
  25. struct is_applicable_property_trait<T, Property,
  26. void_t<
  27. enable_if_t<
  28. !!Property::template is_applicable_property_v<T>
  29. >
  30. >> : true_type
  31. {
  32. };
  33. #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
  34. } // namespace detail
  35. template <typename T, typename Property, typename = void>
  36. struct is_applicable_property :
  37. detail::is_applicable_property_trait<T, Property>
  38. {
  39. };
  40. #if defined(ASIO_HAS_VARIABLE_TEMPLATES)
  41. template <typename T, typename Property>
  42. constexpr const bool is_applicable_property_v
  43. = is_applicable_property<T, Property>::value;
  44. #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
  45. } // namespace asio
  46. #endif // ASIO_IS_APPLICABLE_PROPERTY_HPP