J
joecook
Hmm... Why doesn't this work and use the conversion operator? (It
doesn't compile)
template<typename T>
class Foo
{
};
template<typename T>
void bar(Foo<T>& a){}
template<typename T>
class Goo
{
public:
operator Foo<U>(){return m_foo;}
Foo<U> m_foo;
};
int main()
{
Goo<float> g;
bar(g); // why doesn't this convert to Foo<U> ??
}
Thanks
doesn't compile)
template<typename T>
class Foo
{
};
template<typename T>
void bar(Foo<T>& a){}
template<typename T>
class Goo
{
public:
operator Foo<U>(){return m_foo;}
Foo<U> m_foo;
};
int main()
{
Goo<float> g;
bar(g); // why doesn't this convert to Foo<U> ??
}
Thanks