-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
Description
Currently, the following code fails to compile:
template<int X, int Y> bool foo() { return X == Y; }
int main()
{
foo<3,4>();
ASSERT(foo<3,4>());
}
This code can be seen in action on compiler explorer.
This is due to foo<3,4>()
being seen as two arguments when passed to a macro, specifically foo<3
and 4>()
. This can be worked around with an extra set of parenthesis. Working around this in the library would be difficult, but should be possible. Decomposition would need to overload operator,
to handle the error message string, and additional diagnostic variables. The top level macros would then consume a single variadic argument pack.