user2711253
user2711253

Reputation: 43

Template naming

I have a question about template naming, e.g.

template <typename T, typename U>
class Something {...};

What does [U] mean?
[T] is maybe "Template"
[U] is what...?

I thought it's alphabet order: ...T U V W X Y Z?

Upvotes: 2

Views: 157

Answers (1)

Rahul Tripathi
Rahul Tripathi

Reputation: 172458

There is no specific reason for that. Its just an arbitrary alphabet token taken. Yes you can say that it is taken in alphabetical order. No other reason.

Different programmers have different patterns like if its a single template parameter, then I also take it as T(U,V..etc). But when it is a multiple template parameter I prefer to give a descriptive name(but this all is a matter of style)

Upvotes: 4

Related Questions