This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] Remove fpos<>::operator== and !=
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 29 Mar 2006 15:58:24 -0800
- Subject: Re: [Patch] Remove fpos<>::operator== and !=
- References: <4414BA70.5040808@suse.de>
Paolo Carlini wrote:
> Hi,
>
> a few days ago, while working on something else, I noticed that this
> kind of code did compile:
>
> std::streampos pos;
> ...
> -1 != pos
>
> and this one did not:
>
> std::streampos pos;
> ...
> pos != -1
>
> The inconsistency is due to operator== and operator!= being member
> functions, and, I maintain, not really needed, because fpos has got a
> conversion operator to streamoff (a signed integer type). I propose to
> simply remove the operators, and just exploit the conversions - I cannot
> see anything wrong with that - will wait until tomorrow in case of
> different opinions.
I don't know exactly what source/binary constraints libstdc++ is
operating under, but that seems like an incompatible change, as
"pos::operator==(-1)" will presumably no longer work?
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713