"Paul Mensonides" <[EMAIL PROTECTED]> writes:

> ----- Original Message -----
> From: "David Abrahams" <[EMAIL PROTECTED]>
>
>> Thoughts?
>
> We also need this:
>
> template<class func> inline func& ambiguity_cast(func& rf) {
>     return rf;
> }
>
> ...which casts away ambiguity of a function call--even by return type.
> Maybe add a static assertion to enforce function types.
>
> #include <iostream>
>
> namespace A {
>     int f() {
>         std::cout << "int A::f()" << &std::endl;
>         return 0;
>     }
> }
>
> namespace B {
>     double f() {
>         std::cout << "double B::f()" << &std::endl;
>         return 0.0;
>     }
> }
>
> using A::f;
> using B::f;
>
> int main() {
>     ambiguity_cast<double ()>(f)();
>     return 0;
> }


How is this different from 

    implicit_cast<double(&)()>(f)()

??


-- 
                       David Abrahams
   [EMAIL PROTECTED] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to