template <int K>
class Wrap
{
// stuffs
};
What is wrong if I instantiate the template like Wrap < 5>4 > p;
?
I get expected unqualified-id before numeric constant error. How to fix this?
Change Wrap < 5>4 > p;
to Wrap < (5>4) > p;
The first >
encountered is taken as the end of the template argument list rather than greater than operator >
ISO C++ [14.2/3]
When parsing a template-id, the first non-nested
>
is taken as the end of the template argument-list rather than a greater-than operator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With