help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: overloaded inserters and extractors


From: Thomas Maeder
Subject: Re: overloaded inserters and extractors
Date: Wed, 19 Oct 2005 08:32:26 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

[Why this Followup-To: header???]

"jalkadir" <jalkadir@gosonic.ca> writes:

> I my program I have overloaded the inserters and extractor operator.
> ---name.hpp
>     friend std::ostream& std::operator<<( std::ostream& os,
>                                      const jme::Name& obj );
>     friend std::istream& std::operator>>( std::istream& is,
>                                      jme::Name& obj );

You can't do that.

The namespace std is sealed; the set of things we mere users are
allowed to do in it is restricted. Adding an operator overload is not
one of the things we are allowed to do.

Make these operators members of namespace jme.


Apart from that: What are these operators friend of?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]