I get compile error with the former but latter works just fine.
error: ‘>>’ should be ‘> >’ within a nested template argument list
Thanks
In the (now obsolete) revisions C++98 and C++03, the character sequence ">>" was unconditionally interpreted as the "right shift operator" token, so if you wanted to close multiple template argument lists, you would need to leave some intervening whitespace.
As of C++11, the lexical rules of the language have been modified to interpret ">>" as two consecutive template argument list ends, and the whitespace is no longer necessary. (However, this makes it necessary to parenthesize shift expressions in a template argument list.)
(In the same wash, C++11 also interprets <::foo
, when used as the first template argument, in the "obvious" way (beginning of argument list, followed by namespace qualifier) rather than consuming <:
as the alternative token for [
.)
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