class B { public: int b; }; template <class T> class C; class A { int a; public: A(const B &b) : a(b.b) {} }; template <class T> class C { public: T c; C(const T &n) : c(n) {} }; template <class T> inline const A &operator << (const A &a, const C<T> &c) { return a; } template <class T> inline const A &operator << (const B &b, const T &c) { return A(b) << C<T>(c); } int main() { B b; b << 1.2; return 0; }