In:

#include    <iostream>
struct foo {};
struct bar { operator foo() {} };

template<typename T>
void baz(const T& f) { std::cerr << "template\n"; }
void baz(foo f) { std::cerr << "convert\n"; }
int main() {
    bar b;
    baz(b);
    }

you get:
~/ootbc/members/src$ a.out
template

Is this correct?

Ivan


-- 
           Summary: "match anything" template wins over conversion operator
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24492

Reply via email to