Using the detection idiom to determine whether a type has a constructor with a specific signature
问题 I'm playing with the proposal of standard library support for the C++ detection idiom. It is a trait-like metafunction that determines whether a type T has a type member named T::type or a member function with a specific signature, e.g.: #include <iostream> template<class...> using void_t = void; template<class, template<class> class, class = void_t<>> struct detect : std::false_type { }; template<class T, template<class> class Operation> struct detect<T, Operation, void_t<Operation<T>>> :