devxlogo

Template Parameters and Template Arguments

The terms template argument and template parameter do not mean the same thing. A template parameter is a symbol, or a placeholder which is replaced by the actual argument when you instantiate a template. For example, T in the following template is a template parameter:

 template < class T > class List{ //..};


A template argument is a typename or a const value that a template instance uses. For example:

 List  li; // 'int' is a template argument


The parameter T is substituted for the arguments ‘int’ when the List specialization is instantiated.

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  Five Early Architecture Decisions That Quietly Get Expensive

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.