Я написал следующую программу, которая использует require без круглых скобок. Программа компилируется с помощью msvc, но не с помощью gcc и clang. Я хочу знать, какой компилятор находится здесь. Демо
Код: Выделить всё
#include
template requires !std::is_enum_v
void foo(T)
{
}
int main()
{
foo(4); //msvc compile but not gcc and clang
}
Код: Выделить всё
:3:31: error: expression must be enclosed in parentheses
3 | template requires !std::is_enum_v
| ^~~~~~~~~~~~~~~~~~
| ( )
Compiler returned: 1
Источник: https://stackoverflow.com/questions/781 ... ted-by-gcc