devxlogo

Template Parameters and Template Arguments

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.

See also  11 Effective Keyword Research Tools and Techniques
devxblackblue

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.

About Our Journalist