Out of curiosity why would you do something like this?
Anil

On Tue, May 25, 2010 at 12:45 PM, Modeling Expert <
[email protected]> wrote:

> 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]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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.

Reply via email to