Код: Выделить всё
#include
template
struct CheckX
{
using TypeOfX = decltype(T::x);
using Value = void;
};
struct A
{
};
struct B
{
int x;
};
template
struct Res
{
static constexpr bool value = false;
};
// template
// struct Res
// {
// static constexpr bool value = true;
// };
template
struct Res
{
static constexpr bool value = true;
};
int main()
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78829587/stdvoid-t-vs-customize-function-in-sfinae-usage[/url]