Pomaxa
Pomaxa

Reputation: 23

C++ : Symbols '<' and '>' in "template <smt> class_name" are overloaded or it's simply syntax?

In "template class_name" symbols '<' and '>' are overloaded or they are only specific syntax?

Upvotes: 2

Views: 47

Answers (2)

R Sahu
R Sahu

Reputation: 206577

They are elements of the syntax.

From the n3337 draft standard:

14 Templates

1 A template defines a family of classes or functions or an alias for a family of types.

template-declaration:

template < template-parameter-list > declaration

template-parameter-list:

template-parameter

template-parameter-list , template-parameter

Upvotes: 0

P0W
P0W

Reputation: 47794

Its simply a syntax

template < parameter-list > declaration

Upvotes: 1

Related Questions