Anthony D. Baye <Sha### [at] spamnomorehotmailcom> wrote:
> I also tried declaring it as a class function:
This works just fine:
//----------------------------------------------------------------------
#include <iostream>
namespace geometry
{
class A
{
public:
int value() const { return 5; }
};
inline std::ostream& operator<<(std::ostream& os, const A& obj)
{
os << obj.value();
return os;
}
}
int main()
{
geometry::A a;
std::cout << a << std::endl;
}
//----------------------------------------------------------------------
--
- Warp
Post a reply to this message
|