C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

template vs. ordinary functions how it is overloaded

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Thu Jul 20, 2006 9:10 am    Post subject: template vs. ordinary functions how it is overloaded Reply with 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
Carlos Martinez
Guest





PostPosted: Thu Jul 20, 2006 9:11 am    Post subject: Re: template vs. ordinary functions how it is overloaded Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.