// Bug: g++ doesn't find the conversion from ostream_withassign to ostream. #include template struct A { T t; }; template ostream & operator<< (ostream & os, A & a) { os << a.t; return os; } int main () { A a = { 1 }; cout << a << endl; }