seanbaxter / circle

The compiler is available for download. Get it!
http://www.circle-lang.org/
2.42k stars 74 forks source link

Can't deduce return of operator auto when the result involves a template #199

Open correaa opened 10 months ago

correaa commented 10 months ago

The compiler can't deduce return of operator auto() when the result is a template:

#include <vector>

template<class T>
struct A {
    std::vector<T> v;
    operator auto() const {return v;}
    // operator std::vector<T>() const {return v;}
};

int main() {
    A<double> a;
    std::vector<double> d = a;
}

https://godbolt.org/z/77Mr95ffv