May 15, 2002 Default parameter in template function | ||||
|---|---|---|---|---|
| ||||
Greetings,
It seems that invoking a template function with a default parameter more than
once in a unit causes "redefinition of default parameter" error.
The following code triggers the problem:
template <class T>
void myFunc(int=1);
void main()
{
myFunc<int>();
myFunc<int>();
}
Dimitri Kaparis,
Independent Developer
http://www.universalstudyhelper.com - software to help you study any subject.
| ||||
May 15, 2002 Re: Default parameter in template function | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Dimitri Kaparis | Thanks for reporting this. -Walter "Dimitri Kaparis" <dkaparis@universalstudyhelper.com> wrote in message news:abu60i$864$1@digitaldaemon.com... > Greetings, > > It seems that invoking a template function with a default parameter more than > once in a unit causes "redefinition of default parameter" error. The following code triggers the problem: > > template <class T> > void myFunc(int=1); > > void main() > { > myFunc<int>(); > myFunc<int>(); > } > > Dimitri Kaparis, > Independent Developer > http://www.universalstudyhelper.com - software to help you study any subject. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply