Relative Content

Tag Archive for c++template-meta-programmingsfinae

std::void_t vs customize function in SFINAE usage

#include <iostream> template <typename T> struct CheckX { using TypeOfX = decltype(T::x); using Value = void; }; struct A { }; struct B { int x; }; template <typename T , typename = void> struct Res { static constexpr bool value = false; }; // template <typename T> // struct Res<T , std::void_t<decltype(T::x)>> // { […]