Код: Выделить всё
template
struct foo {
using bar = int;
};
class incomplete;
using incomplete_fb = foo::bar;
int main() {
incomplete_fb i = 0;
}
Код: Выделить всё
template
struct foo {
using bar = int;
};
template
requires (sizeof(T) == 8)
struct foo {};
class incomplete;
using incomplete_fb = foo::bar;
struct incomplete {
double d;
};
static_assert(sizeof(incomplete) == 8);
int main() {
incomplete_fb i = 0;
}
Это ошибка или UB?
Связанный вопрос:
Особые правила относительно SFINAE для неполных типов
Подробнее здесь: https://stackoverflow.com/questions/797 ... ept-sfinae
Мобильная версия