c++ - Default parameter in template function
- Dimitri Kaparis (14/14) May 15 2002 Greetings,
- Walter (5/19) May 15 2002 Thanks for reporting this. -Walter
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
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 morethanonce 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 anysubject.
May 15 2002