Основной шаблон:
Код: Выделить всё
#include
#include
template
struct is_variant : std::false_type {};
template
struct is_variant<
V, std::void_t>
: std::true_type {};
static_assert(not is_variant::value); // fails
< /code>
Тем не менее, он работает, когда я изменяю специализацию, как ниже: < /p>
Код: Выделить всё
template
struct is_variant<
V, std::void_t>
: std::true_type {};
static_assert(not is_variant::value); // passes
< /code>
Мне интересно, почему. Может ли Decltype Подробнее здесь: https://stackoverflow.com/questions/795 ... ble-sfinae
Мобильная версия