This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Remove fpos<>::operator== and !=


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]