"Al-Burak" <[EMAIL PROTECTED]> 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.
_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus