devxlogo

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< 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 << sequence, so a typedef can be used to improve readability both for the compiler and the human reader:

 	typedef  vector msg;	vector vmessages;

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Engineering Leaders Spot Weak Proposals

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.