0

Here is the ?

To use a template construct, what phrase must come before the class definition?

My friend said that should be the parameter, but think that its the
argument,

Next ? is

in the statement

List<int> mylist;

the word int is known as the template _______________?

I said it was the parameter, and my friend said that it was the argument.

can anybody help us out???

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Narue
0

>Here is the ?
>Next ? is
? is a sentence modifier. It has no meaning by itself in literature. Please spell out the word "question" for those of us that abhor useless abbreviations and shortcuts. Thanks.

>My friend said that should be the parameter, but think that its the argument
The whole thing is called a template declaration. The formal grammar for it is:

[I]template-declaration[/I]:
        export[I](opt)[/I] template < [I]template-parameter-list[/I] > [I]declaration[/I]

Where the declaration at the end is a class or function definition. The parts before the declaration aren't treated as a single unit, and thus don't have a unifying name.

>I said it was the parameter, and my friend said that it was the argument.
The C++ standard calls it a parameter, so you're correct.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.