 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Thu Jul 20, 2006 9:10 am Post subject: template vs. ordinary functions how it is overloaded |
|
|
can u let me know if two functions having same name foo(), one is
atemplate function and otherone being ordinary function. if i invoked
the function from main(), which function is to called & why.
thanks |
|
| Back to top |
|
 |
Carlos Martinez Guest
|
Posted: Thu Jul 20, 2006 9:11 am Post subject: Re: template vs. ordinary functions how it is overloaded |
|
|
Ordirary function is called first.
The reason is because standard says:
F1 is preferred over F2 if
"
....
— F1 is a nontemplate
function and F2 is a template function specialization,
....
"
Take a look at ISO/IEC 14882.
13.3.3 Best Viable Function.
Or find it inside the 2003 standard.
dalu.gelu (AT) gmail (DOT) com wrote:
| Quote: | can u let me know if two functions having same name foo(), one is
atemplate function and otherone being ordinary function. if i invoked
the function from main(), which function is to called & why.
thanks
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|