"Al-Burak" <jalqadir@netscape.net> writes:
Correction
I accidentally forgot to add the name of the namespace
As suspected.
--------- name.cpp
std::ostream& operator<<( std::ostream& os, const jme::Name& obj ) {
return os << obj.getNameStr(); }
std::istream& operator>>( std::istream& is, jme::Name& obj ) {
return is >> obj.str;
}
This is your problem. As defined here, these operators belong to the
global namespace. But you want them to belong to the namespace jme:
namespace jme
{
std::ostream &operator<<(std::ostream &os, Name const &obj)
{
return os << obj.getNameStr();
}
std::istream &operator>>(std::istream &is, Name &obj)
{
return is >> obj.str;
}
}
and you should be fine.