File indexing completed on 2025-01-18 09:40:40
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_MATH_TOOLS_IS_DETECTED_HPP
0009 #define BOOST_MATH_TOOLS_IS_DETECTED_HPP
0010
0011 #include <type_traits>
0012
0013 namespace boost { namespace math { namespace tools {
0014
0015 template <typename...>
0016 using void_t = void;
0017
0018 namespace detail {
0019
0020 template <typename Default, typename AlwaysVoid, template<typename...> class Op, typename... Args>
0021 struct detector
0022 {
0023 using value_t = std::false_type;
0024 using type = Default;
0025 };
0026
0027 template <typename Default, template<typename...> class Op, typename... Args>
0028 struct detector<Default, void_t<Op<Args...>>, Op, Args...>
0029 {
0030 using value_t = std::true_type;
0031 using type = Op<Args...>;
0032 };
0033
0034 }
0035
0036
0037 struct nonesuch
0038 {
0039 nonesuch() = delete;
0040 ~nonesuch() = delete;
0041 nonesuch(const nonesuch&) = delete;
0042 void operator=(const nonesuch&) = delete;
0043 };
0044
0045 template <template<typename...> class Op, typename... Args>
0046 using is_detected = typename detail::detector<nonesuch, void, Op, Args...>::value_t;
0047
0048 template <template<typename...> class Op, typename... Args>
0049 using detected_t = typename detail::detector<nonesuch, void, Op, Args...>::type;
0050
0051 template <typename Default, template<typename...> class Op, typename... Args>
0052 using detected_or = detail::detector<Default, void, Op, Args...>;
0053
0054 }}}
0055
0056 #endif