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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That should be intuitively obvious just by looking at the statement: it’s confusing even for humans! The compiler has no way of coping with the double meaning of
>here: does it mean “greater than”? Does it mean “close the template argument list”? Turns out, it means both, and the compiler has no hint as to which meaning to apply where. Both are technically valid parses.