devxlogo

A template’s template argument

A template’s template argument

Standard C++ supports templates’ template arguments. For instance, a mail server class can store incoming messages in a vector of vector(s) of bytes:

 	vector > vmessages;

Please note that the space between the left two angular brackets is mandatory. Otherwise, a >> sequence is parsed as the right shift operator. The same is true, of course, for a typedef vector msg; vector vmessages;

devx-admin

Share the Post: