is_applicable_property.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // is_applicable_property.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2021 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 BOOST_ASIO_IS_APPLICABLE_PROPERTY_HPP
  11. #define BOOST_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 <boost/asio/detail/config.hpp>
  16. #include <boost/asio/detail/type_traits.hpp>
  17. namespace boost {
  18. namespace asio {
  19. namespace detail {
  20. template <typename T, typename Property, typename = void>
  21. struct is_applicable_property_trait : false_type
  22. {
  23. };
  24. #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
  25. template <typename T, typename Property>
  26. struct is_applicable_property_trait<T, Property,
  27. typename void_type<
  28. typename enable_if<
  29. !!Property::template is_applicable_property_v<T>
  30. >::type
  31. >::type> : true_type
  32. {
  33. };
  34. #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
  35. } // namespace detail
  36. template <typename T, typename Property, typename = void>
  37. struct is_applicable_property :
  38. detail::is_applicable_property_trait<T, Property>
  39. {
  40. };
  41. #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
  42. template <typename T, typename Property>
  43. BOOST_ASIO_CONSTEXPR const bool is_applicable_property_v
  44. = is_applicable_property<T, Property>::value;
  45. #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
  46. } // namespace asio
  47. } // namespace boost
  48. #endif // BOOST_ASIO_IS_APPLICABLE_PROPERTY_HPP