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:04:03 +0100

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
Received on Tue Dec 17 2013 - 17:04:12 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 17 2013 - 12:00:11 MST