When parsing a
template-argument-list,
the first non-nested
>
is taken as the ending delimiter
rather than a greater-than operator
. Similarly, the first non-nested
>> is treated as two
consecutive but distinct
> tokens, the first of which is taken
as the end of the
template-argument-list and completes
the
template-id. [
Note 2:
The second
>
token produced by this replacement rule could terminate an enclosing
template-id construct or it could be part of a different
construct (e.g., a cast)
. —
end note]
[
Example 1:
template<int i> class X { };
X< 1>2 > x1;
X<(1>2)> x2;
template<class T> class Y { };
Y<X<1>> x3;
Y<X<6>>1>> x4;
Y<X<(6>>1)>> x5;
—
end example]