Boost logo

Boost Users :

Subject: [Boost-users] Operator overloading of a class template in a namespace
From: Surya Kiran Gullapalli (suryakiran.gullapalli_at_[hidden])
Date: 2010-01-29 01:04:24


Hello all,
Let me give you a heads up first. This is a general c++ question. not a
boost one. But posting it here as we've C++ gurus out there. I've this piece
of code

http://paste.pocoo.org/show/171324/

The code fails to compile when *St.1 *is uncommented. I read some documents
on operator overloading and namespaces and moved the output operator into
the same namespace as the class (skg). This works fine.

But my question is different.
If the output operator is in global namespace and class in skg namespace *St.
2 * (cout statement) works fine, but not the copy statement. Why ?

Thanks in advance, and apologies for offtopic.
Surya



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net