Re: [PATCH] Make SBuf::find_first_of O(N) and implement find_first_not_of

From: Kinkie <gkinkie_at_gmail.com>
Date: Tue, 17 Dec 2013 18:35:02 +0100

Hi all,
  here's the updated patch.

Thanks

On Tue, Dec 17, 2013 at 6:04 PM, Kinkie <gkinkie_at_gmail.com> wrote:
> On Tue, Dec 17, 2013 at 6:06 AM, Alex Rousskov
> <rousskov_at_measurement-factory.com> wrote:
>> On 12/16/2013 03:36 PM, Alex Rousskov wrote:
>>>> Rewrite the += operator loop to simply
>>>> this->add() every character in the src set. Use std::for_each or another
>>>> <algorithm> for that if possible.
>>
>>> I think the above is still valid though.
>>
>> but I cannot find a suitable algorithm. If you cannot either, just use
>> add() calls in an explicit loop.
>
> std::copy_if is perfect for the job; using that.
>
> --
> /kinkie

-- 
    /kinkie

Received on Tue Dec 17 2013 - 17:35:11 MST

This archive was generated by hypermail 2.2.0 : Wed Dec 18 2013 - 12:00:12 MST