W
William Xu
Compiling:
template <class T = int>
T foo(const T& t)
{}
int main(int argc, char *argv[])
{}
gcc complains:
,----
| /Users/william/repo/helloworlds/foo.cpp:2: error: default template
| arguments may not be used in function templates
`----
But I find in "TC++PL(3rd, special edition)" P.340, Bjarne is giving
function templates with default template parameters as examples.
If current standard doesn't support it, what is the reason here?
template <class T = int>
T foo(const T& t)
{}
int main(int argc, char *argv[])
{}
gcc complains:
,----
| /Users/william/repo/helloworlds/foo.cpp:2: error: default template
| arguments may not be used in function templates
`----
But I find in "TC++PL(3rd, special edition)" P.340, Bjarne is giving
function templates with default template parameters as examples.
If current standard doesn't support it, what is the reason here?