Re: RFC: SBuf::find api

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Tue, 26 Mar 2013 15:24:33 -0600

On 03/24/2013 10:35 AM, Kinkie wrote:

> digging up some documentation for the inconsistent behavior of
> std::string::find() in GCC, it appears that its behavior is undefined
> if the pos parameter is std::string::npos.

> I'd like to define that behavior by making it explicit in the API that
> SBuf::find (in any variant) when called with pos=SBuf::npos will
> return SBuf::npos. This is consistent with recent gcc, but not with
> the current implementation

If the standard says the behavior is undefined, we should mimic what GCC
implementation does. If GCC versions are inconsistent in this regard,
your suggestion sounds good to me, especially if it matches latest GCC
implementations.

Please note that you may need to adjust test cases to accommodate this
change if we want them to pass on all supported GCC versions and those
versions are inconsistent.

Thank you,

Alex.
Received on Tue Mar 26 2013 - 21:24:38 MDT

This archive was generated by hypermail 2.2.0 : Wed Mar 27 2013 - 12:00:25 MDT