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 11 #ifndef BOOST_ASIO_IS_APPLICABLE_PROPERTY_HPP 12 #define BOOST_ASIO_IS_APPLICABLE_PROPERTY_HPP 13 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 # pragma once 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 18 #include <boost/asio/detail/config.hpp> 19 #include <boost/asio/detail/type_traits.hpp> 20 21 namespace boost { 22 namespace asio { 23 namespace detail { 24 25 template <typename T, typename Property, typename = void> 26 struct is_applicable_property_trait : false_type 27 { 28 }; 29 30 #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES) 31 32 template <typename T, typename Property> 33 struct is_applicable_property_trait<T, Property, 34 typename void_type< 35 typename enable_if< 36 !!Property::template is_applicable_property_v<T> 37 >::type 38 >::type> : true_type 39 { 40 }; 41 42 #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES) 43 44 } // namespace detail 45 46 template <typename T, typename Property, typename = void> 47 struct is_applicable_property : 48 detail::is_applicable_property_trait<T, Property> 49 { 50 }; 51 52 #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES) 53 54 template <typename T, typename Property> 55 BOOST_ASIO_CONSTEXPR const bool is_applicable_property_v 56 = is_applicable_property<T, Property>::value; 57 58 #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES) 59 60 } // namespace asio 61 } // namespace boost 62 63 #endif // BOOST_ASIO_IS_APPLICABLE_PROPERTY_HPP 64