220 7171 <f5a8968e-3d90-49b3-82a6-c65ac5bbc8a6@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Vlad from Moscow <vlad.moscow@mail.ru>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: "count_while" and "count_until" algorithms
Date: Tue, 8 Oct 2013 13:37:13 -0700 (PDT)
Lines: 341
Approved: news@gmane.org
Message-ID: <f5a8968e-3d90-49b3-82a6-c65ac5bbc8a6@isocpp.org>
References: <CAOpASk64dV+3ZUW+Z8wcEqug_oSaztvJp1zsDB_QdAxi+fwcsA@mail.gmail.com>
 <285a478e-ce03-42b9-9196-c7d0855e11aa@isocpp.org>
 <82850309-b16b-44bd-b478-e2e63e43d6ca@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_501_26566878.1381264633462"
X-Trace: ger.gmane.org 1381264638 1485 80.91.229.3 (8 Oct 2013 20:37:18 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 8 Oct 2013 20:37:18 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCXLLRHD7IDRB66Z2GJAKGQEDU4SB4A@isocpp.org Tue Oct 08 22:37:19 2013
Return-path: <std-proposals+bncBCXLLRHD7IDRB66Z2GJAKGQEDU4SB4A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oa0-f70.google.com ([209.85.219.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCXLLRHD7IDRB66Z2GJAKGQEDU4SB4A@isocpp.org>)
	id 1VTe1s-0005Z0-DR
	for gclcip-std-proposals@m.gmane.org; Tue, 08 Oct 2013 22:37:16 +0200
Original-Received: by mail-oa0-f70.google.com with SMTP id g12sf28816333oah.5
        for <gclcip-std-proposals@m.gmane.org>; Tue, 08 Oct 2013 13:37:15 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=SWEG9TKufcsbqb17ZvFFK50AdGkzCr1StdEN1798/sA=;
        b=fKBFxTvfmUQbZBGJGnlwR9QQN5DX+VS+9E8xO2sdb89lkNGaui32sAumAAqakXYb44
         HtAOa0QrvQJJZUpcekqqKxQKc6paqNKZ3Qpk+qb3zvsCiZyTgEMzADjiWFBU2m+ySqP1
         M3TyoTXEnkxga27kWWi6FRCRu1AcCS9txEBgfmWciF8NMmfmu0H0FuVtrQFr42Ntp/08
         rJuSgKbVt7dbWJKl41DlyPn4ZplayyIwAIRwKdre6iVrSOp6p4wPw7gGE2wCkhG7meIt
         JyYFRpBdarcQMD/Cijg9tSuULlfG1lBraudY/7txumUr6xif5KjJ6u9r4bQorGMkxb7q
         EafA==
X-Received: by 10.50.129.42 with SMTP id nt10mr2285404igb.0.1381264635374;
        Tue, 08 Oct 2013 13:37:15 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.67.48 with SMTP id k16ls735067igt.40.gmail; Tue, 08 Oct
 2013 13:37:14 -0700 (PDT)
X-Received: by 10.50.25.98 with SMTP id b2mr1067015igg.3.1381264634922;
        Tue, 08 Oct 2013 13:37:14 -0700 (PDT)
In-Reply-To: <82850309-b16b-44bd-b478-e2e63e43d6ca@isocpp.org>
X-Original-Sender: vlad.moscow@mail.ru
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:7171
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7171>

------=_Part_501_26566878.1381264633462
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

So I would propose name count_first_if instead of the both suggested=20
algorithms count_until and count_while.
=20

=D1=81=D1=80=D0=B5=D0=B4=D0=B0, 9 =D0=BE=D0=BA=D1=82=D1=8F=D0=B1=D1=80=D1=
=8F 2013 =D0=B3., 0:35:01 UTC+4 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=
=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Vlad from Moscow=20
=D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:

> Or the following definition
> =20
> [code]
> template <class InputIterator, class T, class UnaryPredicate>
> T accumulate_first_if( InputIterator first,=20
>                     InputIterator last,
>         T init,
>         UnaryPredicate unary_predicate )
> {
>  for ( ; first !=3D last && unary_predicate( *first ) ; ++first )
>  {
>   init =3D ( T )( init + *first );
>  }
>  return ( init );
> }
> [/code]
>
> =D1=81=D1=80=D0=B5=D0=B4=D0=B0, 9 =D0=BE=D0=BA=D1=82=D1=8F=D0=B1=D1=80=D1=
=8F 2013 =D0=B3., 0:32:31 UTC+4 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=
=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Vlad from Moscow=20
> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>
>> =20
>> [code]
>> In some thread here I proposed the similar idea for algorithm=20
>> std::accumulate.
>> template <class InputIterator, class T, class UnaryPredicate, class=20
>> BinaryOperation>
>> T accumulate_first_if( InputIterator first,=20
>>                     InputIterator last,
>>         T init,
>>         UnaryPredicate unary_predicate,
>>         BinaryOperation binary_operation )
>> {
>>  for ( ; first !=3D last && unary_predicate( *first ) ; ++first )
>>  {
>>   init =3D binary_operation( init, *first );
>>  }
>>  return ( init );
>> }
>> [/code]
>> =D1=81=D1=80=D0=B5=D0=B4=D0=B0, 9 =D0=BE=D0=BA=D1=82=D1=8F=D0=B1=D1=80=
=D1=8F 2013 =D0=B3., 0:04:23 UTC+4 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=
=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C R=C3=A9my Lefevre =D0=BD=D0=B0=D0=BF=D0=
=B8=D1=81=D0=B0=D0=BB:
>>
>>> Hi,
>>>
>>> I thought about two new algorithms, that could be named "count_while"=
=20
>>> and "count_until". Here are their behavior:
>>>
>>> template <class InputIterator, class UnaryPredicate>
>>>
>>>
>>>   typename iterator_traits<InputIterator>::difference_type
>>>
>>>
>>>     count_while (InputIterator first, InputIterator last, UnaryPredicat=
e pred)
>>>
>>> {
>>>   typename iterator_traits<InputIterator>::difference_type ret =3D 0;
>>>
>>>
>>>   while (first!=3Dlast && pred(*first)) {
>>>
>>>
>>>     ++ret;
>>>     ++first;
>>>
>>>
>>>   }
>>>   return ret;
>>>
>>> }
>>>
>>>
>>> template <class InputIterator, class UnaryPredicate>
>>>
>>>
>>>   typename iterator_traits<InputIterator>::difference_type
>>>
>>>
>>>     count_until (InputIterator first, InputIterator last, UnaryPredicat=
e pred)
>>>
>>> {
>>>
>>>   typename iterator_traits<InputIterator>::difference_type ret =3D 0;
>>>
>>>
>>>   while (first!=3Dlast && !pred(*first)) {
>>>
>>>
>>>     ++ret;
>>>     ++first;
>>>
>>>
>>>   }
>>>   return ret;
>>>
>>>
>>> }
>>>
>>>
>>> What do you think about adding these two components to the algorithms=
=20
>>> library ?
>>>
>>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_501_26566878.1381264633462
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>So I would propose name count_first_if instead of the=
 both suggested algorithms count_until and count_while.</div><div>&nbsp;</d=
iv><div><br>=D1=81=D1=80=D0=B5=D0=B4=D0=B0, 9 =D0=BE=D0=BA=D1=82=D1=8F=D0=
=B1=D1=80=D1=8F 2013&nbsp;=D0=B3., 0:35:01 UTC+4 =D0=BF=D0=BE=D0=BB=D1=8C=
=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Vlad from Moscow =D0=BD=D0=
=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rg=
b(204, 204, 204); border-left-width: 1px; border-left-style: solid;"><div d=
ir=3D"ltr"><div>Or the following definition</div><div>&nbsp;</div><div>[cod=
e]</div><div>template &lt;class InputIterator, class T, class UnaryPredicat=
e&gt;<br>T accumulate_first_if( InputIterator first, <br>&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; InputIterator last,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp; T init,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UnaryPre=
dicate unary_predicate )<br>{<br>&nbsp;for ( ; first !=3D last &amp;&amp; u=
nary_predicate( *first ) ; ++first )<br>&nbsp;{<br>&nbsp;&nbsp;init =3D ( T=
 )( init + *first );<br>&nbsp;}</div><div>&nbsp;return ( init );<br>}<br></=
div><div>[/code]</div><div><br>=D1=81=D1=80=D0=B5=D0=B4=D0=B0, 9 =D0=BE=D0=
=BA=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2013&nbsp;=D0=B3., 0:32:31 UTC+4 =D0=BF=
=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Vlad fro=
m Moscow =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:</div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><div dir=3D"ltr"><div>&nbsp;</div><div>[code]</div><div>In some=
 thread here I proposed the similar idea for algorithm std::accumulate.</di=
v><div>template &lt;class InputIterator, class T, class UnaryPredicate, cla=
ss BinaryOperation&gt;<br>T accumulate_first_if( InputIterator first, <br>&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InputIterator last,<br>&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; T init,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; UnaryPredicate unary_predicate,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; BinaryOperation binary_operation )<br>{<br>&nbsp;for ( ; first =
!=3D last &amp;&amp; unary_predicate( *first ) ; ++first )<br>&nbsp;{<br>&n=
bsp;&nbsp;init =3D binary_operation( init, *first );<br>&nbsp;}</div><div>&=
nbsp;return ( init );<br>}<br></div><div>[/code]<br>=D1=81=D1=80=D0=B5=D0=
=B4=D0=B0, 9 =D0=BE=D0=BA=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2013&nbsp;=D0=B3., =
0:04:23 UTC+4 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=
=D0=BB=D1=8C R=C3=A9my Lefevre =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<=
/div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; =
padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width=
: 1px; border-left-style: solid;"><div dir=3D"ltr">Hi,<br><br>I thought abo=
ut two new algorithms, that could be named "count_while" and "count_until".=
 Here are their behavior:<br><br><div style=3D"border: 1px solid rgb(187, 1=
87, 187); word-wrap: break-word; background-color: rgb(250, 250, 250);">

<code><div><pre><code><var><span style=3D"color: rgb(0, 0, 136);">template<=
/span></var><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"col=
or: rgb(102, 102, 0);">&lt;</span><var><span style=3D"color: rgb(0, 0, 136)=
;">class</span></var><span style=3D"color: rgb(0, 0, 0);"> </span><span sty=
le=3D"color: rgb(102, 0, 102);">InputIterator</span><span style=3D"color: r=
gb(102, 102, 0);">,</span><span style=3D"color: rgb(0, 0, 0);"> </span><var=
><span style=3D"color: rgb(0, 0, 136);">class</span></var><span style=3D"co=
lor: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102, 0, 102);">UnaryP=
redicate</span><span style=3D"color: rgb(102, 102, 0);">&gt;</span><span st=
yle=3D"color: rgb(0, 0, 0);"><br>

&nbsp; </span><var><span style=3D"color: rgb(0, 0, 136);">typename</span></=
var><span style=3D"color: rgb(0, 0, 0);"> iterator_traits</span><span style=
=3D"color: rgb(102, 102, 0);">&lt;</span><span style=3D"color: rgb(102, 0, =
102);">InputIterator</span><span style=3D"color: rgb(102, 102, 0);">&gt;<wb=
r>::</span><span style=3D"color: rgb(0, 0, 0);">difference_type<br>

&nbsp; &nbsp; count_while </span><span style=3D"color: rgb(102, 102, 0);">(=
</span><span style=3D"color: rgb(102, 0, 102);">InputIterator</span><span s=
tyle=3D"color: rgb(0, 0, 0);"> first</span><span style=3D"color: rgb(102, 1=
02, 0);">,</span><span style=3D"color: rgb(0, 0, 0);"> </span><span style=
=3D"color: rgb(102, 0, 102);">InputIterator</span><span style=3D"color: rgb=
(0, 0, 0);"> </span><span style=3D"color: rgb(0, 0, 136);">last</span><span=
 style=3D"color: rgb(102, 102, 0);">,</span><span style=3D"color: rgb(0, 0,=
 0);"> </span><span style=3D"color: rgb(102, 0, 102);">UnaryPredicate</span=
><span style=3D"color: rgb(0, 0, 0);"> pred</span><span style=3D"color: rgb=
(102, 102, 0);">)</span><span style=3D"color: rgb(0, 0, 0);"><br>

</span><span style=3D"color: rgb(102, 102, 0);">{</span><span style=3D"colo=
r: rgb(0, 0, 0);"><br>&nbsp; </span><var><span style=3D"color: rgb(0, 0, 13=
6);">typename</span></var><span style=3D"color: rgb(0, 0, 0);"> iterator_tr=
aits</span><span style=3D"color: rgb(102, 102, 0);">&lt;</span><span style=
=3D"color: rgb(102, 0, 102);">InputIterator</span><span style=3D"color: rgb=
(102, 102, 0);">&gt;<wbr>::</span><span style=3D"color: rgb(0, 0, 0);">diff=
erence_type ret </span><span style=3D"color: rgb(102, 102, 0);">=3D</span><=
span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(0, 10=
2, 102);">0</span><span style=3D"color: rgb(102, 102, 0);">;</span><span st=
yle=3D"color: rgb(0, 0, 0);"><br>

&nbsp; </span><var><span style=3D"color: rgb(0, 0, 136);">while</span></var=
><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102=
, 102, 0);">(</span><span style=3D"color: rgb(0, 0, 0);">first</span><span =
style=3D"color: rgb(102, 102, 0);">!=3D</span><span style=3D"color: rgb(0, =
0, 136);">last</span><var><span style=3D"color: rgb(0, 0, 0);"> </span><spa=
n style=3D"color: rgb(102, 102, 0);">&amp;&amp;</span><span style=3D"color:=
 rgb(0, 0, 0);"> </span></var><var></var><span style=3D"color: rgb(0, 0, 0)=
;">pred</span><span style=3D"color: rgb(102, 102, 0);">(*</span><span style=
=3D"color: rgb(0, 0, 0);">first</span><span style=3D"color: rgb(102, 102, 0=
);">))</span><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"co=
lor: rgb(102, 102, 0);">{</span><span style=3D"color: rgb(0, 0, 0);"><br>

&nbsp; &nbsp; </span><span style=3D"color: rgb(102, 102, 0);">++</span><spa=
n style=3D"color: rgb(0, 0, 0);">ret</span><span style=3D"color: rgb(102, 1=
02, 0);">;</span><span style=3D"color: rgb(0, 0, 0);"><br>&nbsp; &nbsp; </s=
pan><span style=3D"color: rgb(102, 102, 0);">++</span><span style=3D"color:=
 rgb(0, 0, 0);">first</span><span style=3D"color: rgb(102, 102, 0);">;</spa=
n><span style=3D"color: rgb(0, 0, 0);"><br>

&nbsp; </span><span style=3D"color: rgb(102, 102, 0);">}</span><span style=
=3D"color: rgb(0, 0, 0);"><br>&nbsp; </span><var><span style=3D"color: rgb(=
0, 0, 136);">return</span></var><span style=3D"color: rgb(0, 0, 0);"> ret</=
span><span style=3D"color: rgb(102, 102, 0);">;</span><span style=3D"color:=
 rgb(0, 0, 0);"><br>

</span><span style=3D"color: rgb(102, 102, 0);">}</span></code></pre></div>=
</code></div><br><div style=3D"border: 1px solid rgb(187, 187, 187); word-w=
rap: break-word; background-color: rgb(250, 250, 250);">

<code><div><pre><code><var><span style=3D"color: rgb(0, 0, 136);">template<=
/span></var><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"col=
or: rgb(102, 102, 0);">&lt;</span><var><span style=3D"color: rgb(0, 0, 136)=
;">class</span></var><span style=3D"color: rgb(0, 0, 0);"> </span><span sty=
le=3D"color: rgb(102, 0, 102);">InputIterator</span><span style=3D"color: r=
gb(102, 102, 0);">,</span><span style=3D"color: rgb(0, 0, 0);"> </span><var=
><span style=3D"color: rgb(0, 0, 136);">class</span></var><span style=3D"co=
lor: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102, 0, 102);">UnaryP=
redicate</span><span style=3D"color: rgb(102, 102, 0);">&gt;</span><span st=
yle=3D"color: rgb(0, 0, 0);"><br>

&nbsp; </span><var><span style=3D"color: rgb(0, 0, 136);">typename</span></=
var><span style=3D"color: rgb(0, 0, 0);"> iterator_traits</span><span style=
=3D"color: rgb(102, 102, 0);">&lt;</span><span style=3D"color: rgb(102, 0, =
102);">InputIterator</span><span style=3D"color: rgb(102, 102, 0);">&gt;<wb=
r>::</span><span style=3D"color: rgb(0, 0, 0);">difference_type<br>

&nbsp; &nbsp; count_until </span><span style=3D"color: rgb(102, 102, 0);">(=
</span><span style=3D"color: rgb(102, 0, 102);">InputIterator</span><span s=
tyle=3D"color: rgb(0, 0, 0);"> first</span><span style=3D"color: rgb(102, 1=
02, 0);">,</span><span style=3D"color: rgb(0, 0, 0);"> </span><span style=
=3D"color: rgb(102, 0, 102);">InputIterator</span><span style=3D"color: rgb=
(0, 0, 0);"> </span><span style=3D"color: rgb(0, 0, 136);">last</span><span=
 style=3D"color: rgb(102, 102, 0);">,</span><span style=3D"color: rgb(0, 0,=
 0);"> </span><span style=3D"color: rgb(102, 0, 102);">UnaryPredicate</span=
><span style=3D"color: rgb(0, 0, 0);"> pred</span><span style=3D"color: rgb=
(102, 102, 0);">)</span><span style=3D"color: rgb(0, 0, 0);"><br>

</span><span style=3D"color: rgb(102, 102, 0);">{</span><span style=3D"colo=
r: rgb(0, 0, 0);"><br><code><pre><code><span style=3D"color: rgb(0, 0, 0);"=
>&nbsp; </span><var><span style=3D"color: rgb(0, 0, 136);">typename</span><=
/var><span style=3D"color: rgb(0, 0, 0);"> iterator_traits</span><span styl=
e=3D"color: rgb(102, 102, 0);">&lt;</span><span style=3D"color: rgb(102, 0,=
 102);">InputIterator</span><span style=3D"color: rgb(102, 102, 0);">&gt;<w=
br>::</span><span style=3D"color: rgb(0, 0, 0);">difference_type ret </span=
><span style=3D"color: rgb(102, 102, 0);">=3D</span><span style=3D"color: r=
gb(0, 0, 0);"> </span><span style=3D"color: rgb(0, 102, 102);">0</span><spa=
n style=3D"color: rgb(102, 102, 0);">;</span><span style=3D"color: rgb(0, 0=
, 0);"><br>

&nbsp; </span><var><span style=3D"color: rgb(0, 0, 136);">while</span></var=
><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102=
, 102, 0);">(</span><span style=3D"color: rgb(0, 0, 0);">first</span><span =
style=3D"color: rgb(102, 102, 0);">!=3D</span><span style=3D"color: rgb(0, =
0, 136);">last</span><var><span style=3D"color: rgb(0, 0, 0);"> </span><spa=
n style=3D"color: rgb(102, 102, 0);">&amp;&amp;</span><span style=3D"color:=
 rgb(0, 0, 0);"> </span></var><var></var><span style=3D"color: rgb(0, 0, 0)=
;">!pred</span><span style=3D"color: rgb(102, 102, 0);">(*</span><span styl=
e=3D"color: rgb(0, 0, 0);">first</span><span style=3D"color: rgb(102, 102, =
0);">))</span><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"c=
olor: rgb(102, 102, 0);">{</span><span style=3D"color: rgb(0, 0, 0);"><br>

&nbsp; &nbsp; </span><span style=3D"color: rgb(102, 102, 0);">++</span><spa=
n style=3D"color: rgb(0, 0, 0);">ret</span><span style=3D"color: rgb(102, 1=
02, 0);">;</span><span style=3D"color: rgb(0, 0, 0);"><br>&nbsp; &nbsp; </s=
pan><span style=3D"color: rgb(102, 102, 0);">++</span><span style=3D"color:=
 rgb(0, 0, 0);">first</span><span style=3D"color: rgb(102, 102, 0);">;</spa=
n><span style=3D"color: rgb(0, 0, 0);"><br>

&nbsp; </span><span style=3D"color: rgb(102, 102, 0);">}</span><span style=
=3D"color: rgb(0, 0, 0);"><br>&nbsp; </span><var><span style=3D"color: rgb(=
0, 0, 136);">return</span></var><span style=3D"color: rgb(0, 0, 0);"> ret;<=
br>

}</span><span style=3D"color: rgb(102, 102, 0);"></span></code></pre></code=
></span></code><code><span style=3D"color: rgb(0, 0, 0);"></span><span styl=
e=3D"color: rgb(102, 102, 0);"></span></code></pre></div></code></div>

<br>What do you think about adding these two components to the algorithms l=
ibrary ?</div>
</blockquote></div></blockquote></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_501_26566878.1381264633462--

.
