Sun Studio 12 Update 1: C++ User's Guide

6.7.5 Nesting Template Names

Because the “>>” character sequence is interpreted as the right-shift operator, you must be careful when you use one template names inside another. Make sure you separate adjacent “>” characters with at least one blank space.

For example, the following ill-formed statement:


Array<String<10>> short_string_array(100); // >> = right-shift

is interpreted as:


Array<String<10 >> short_string_array(100);

The correct syntax is:


Array<String<10> > short_string_array(100);