This error message confuses me, because last time I checked, 3 was at least 1.
template<class T, long... i>
struct S
{};
template<class... T>
long xor_fold(T&&... flags)
{
return (flags ^ ... ^ 0);
}
template<long... lhs, bool dummy, long... rhs>
concept test = xor_fold(lhs...) == xor_fold(rhs...);
template<long... lhs, class L, long... rhs, class R>
requires test<lhs..., false, rhs...>
bool operator+(S<L, lhs...>, S<R, rhs...>){return true;}
int main()
{
return 1;
}
error: wrong number of template arguments (3, should be at least 1)
132 | requires test
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
note: provided for 'template concept test'
129 | concept test = f(lhs...) == f(rhs...);
| ^~~~
The overloaded operator should only be valid, if the two operands meet the requirements specified in the concept.
As requested, my compiler version is:
g++ --version
g++ (Rev3, Built by MSYS2 project) 10.1.0