template Clifford3 operator * (const Clifford3 &arg1, const Clifford3 &arg2) { // cout << "Entered multiply with " << arg1 << " * " << arg2 << endl; Clifford3 result(arg1.r*arg2.r + arg1.i*arg2.i + arg1.j*arg2.j + arg1.k*arg2.k - arg1.bi*arg2.bi - arg1.bj*arg2.bj - arg1.bk*arg2.bk - arg1.p*arg2.p, //r (1) arg1.r*arg2.i + arg1.i*arg2.r + arg1.bi*arg2.j - arg1.j*arg2.bi - arg1.bk*arg2.k + arg1.k*arg2.bk - arg1.p*arg2.bj - arg1.bj*arg2.p, //i (s1) arg1.r*arg2.j + arg1.j*arg2.r - arg1.bi*arg2.i + arg1.i*arg2.bi + arg1.bj*arg2.k - arg1.k*arg2.bj - arg1.p*arg2.bk - arg1.bk*arg2.p, //j (s2) arg1.r*arg2.k + arg1.k*arg2.r - arg1.bj*arg2.j + arg1.j*arg2.bj + arg1.bk*arg2.i - arg1.i*arg2.bk - arg1.p*arg2.bi - arg1.bi*arg2.p, //k (s3) arg1.r*arg2.bi + arg1.bi*arg2.r - arg1.j*arg2.i + arg1.i*arg2.j + arg1.k*arg2.p + arg1.p*arg2.k - arg1.bj*arg2.bk + arg1.bk*arg2.bj, //bi(s12) arg1.r*arg2.bj + arg1.bj*arg2.r - arg1.k*arg2.j + arg1.j*arg2.k + arg1.i*arg2.p + arg1.p*arg2.i - arg1.bk*arg2.bi + arg1.bi*arg2.bk, //bj(s23) arg1.r*arg2.bk + arg1.bk*arg2.r - arg1.i*arg2.k + arg1.k*arg2.i + arg1.j*arg2.p + arg1.p*arg2.j - arg1.bi*arg2.bj + arg1.bj*arg2.bi, //bk(s31) arg1.r*arg2.p + arg1.p*arg2.r + arg1.i*arg2.bj + arg1.bj*arg2.i + arg1.j*arg2.bk + arg1.bk*arg2.j + arg1.k*arg2.bi + arg1.bi*arg2.k); //p(s123) cout << "Exiting multiply with " << result << endl; return result; } Section of machine code corresponding with end of the declaration and begining to tidy up (to first call of destructor). NO cout statement. THIS HANGS. call near ptr syscall Clifford3 >::Clifford3 >(Sum const &,Sum const &,Sum const &,Sum const &,Sum const &,Sum const &,Sum const &,Sum const &) mov EDX,8[EBP] mov -4[EBP],EDX lea ECX,-0D0h[EBP] call near ptr syscall Sum::~Sum() The SAME section of the code when the cout statement is compiled. THIS WORKS. call near ptr syscall Clifford3 >::Clifford3 >(Sum const &,Sum const &,Sum const &,Sum const &,Sum const &,Sum const &,Sum const &,Sum const &) push dword ptr 8[EBP] mov EDX,offset DGROUP:ostream_withassign cout mov -4[EBP],EDX mov ESI,offset DGROUP:__stack[084Fh] push 0 push ESI mov ECX,EDX call near ptr void syscall ostream::outstr(char const *,char const *) mov EAX,-4[EBP] push EAX call near ptr ostream &cdecl <<(ostream &,Clifford3 > const &) mov EBX,offset ostream &cdecl endl(ostream &) push EAX call EBX mov EDX,8[EBP] mov -8[EBP],EDX lea ECX,-0D4h[EBP] call near ptr syscall Sum::~Sum() There follow lots of calls to ~Sum() Without cout: call near ptr syscall Sum::~Sum() mov EAX,-4[EBP] pop EDI pop ESI pop EBX leave ret With cout: call near ptr syscall Sum::~Sum() mov EAX,-8[EBP] add ESP,0Ch pop EDI pop ESI pop EBX leave ret