If we have templatized functions , return type becomes part of
function signature ( which is not the case when we have normal non-
templatized functions ) , So we can have two functions like these who
differ only in return type
template<class T> int foo(T)
{ cout << " this " ; }
template<class T> bool foo(T)
{ cout << " that " ; }
Questions is how do I call these functions. If I do like these
int k = foo<int>(12) ; it cribbs that this call is ambiguos. How do we
avoid this ambiguity ??
On googling it I could find one cast which solves this , but I could
not understand it fully
((int(*)(char))foo<char>)('a');
Can some one explain in simple terms.
-Manish
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.