cmoon::detected


Defined in module <cmoon.type_traits>


template<template<class...> class Op, class... Args>
using is_detected = /* see below */;


(1)


template<template<class...> class Op, class... Args>
using detected_t = /* see below */;


(2)


template<class Default, template<class...> class Op, class... Args>
using detected_or = /* see below */;


(3)

  1. An std::integral_constant whose member constant value is true if Op<Args...> is valid, else its member constant value is false.
  2. The type that is a result of Op<Args...> if Op<Args...> is valid. If it is not valid, then the type is cmoon::nonesuch.
  3. The type that is a result of Op<Args...> if Op<Args...> is valid. If it is not valid, then the type is Default.

Additional utilities




template<template<class...> class Op, class... Args>
constexpr inline auto is_detected_v = is_detected<Op, Args...>::value;




template<class Default, template<class...> class Op, class... Args>
using detected_or_t = typename detected_or<Default, Op, Args...>::type;




template<class Expected, template<class...> class Op, class... Args>
using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>;




template<class Expected, template<class...> class Op, class... Args>
constexpr inline auto is_detected_exact_v = is_detected_exact<Expected, Op, Args...>::value;




template<class To, template<class...> class Op, class... Args>
using is_detected_convertible = std::is_convertible<detected_t<Op, Args...>, To>;




template<class To, template<class...> class Op, class... Args>
constexpr inline auto is_detected_convertible_v = is_detected_convertible<To, Op, Args...>::value;