220 7200 <2946a4c1-2cdc-4c31-ad1b-bef0ce40873b@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: Re: "count_while" and "count_until" algorithms
Date: Tue, 8 Oct 2013 15:09:18 -0700 (PDT)
Lines: 171
Approved: news@gmane.org
Message-ID: <2946a4c1-2cdc-4c31-ad1b-bef0ce40873b@isocpp.org>
References: <CAOpASk64dV+3ZUW+Z8wcEqug_oSaztvJp1zsDB_QdAxi+fwcsA@mail.gmail.com>
 <fe7981d7-4eaf-4132-9150-4ec7d3ff7ac4@isocpp.org> <2602b3fd-fccd-459b-be1a-93a12005dc5c@isocpp.org>
 <231e6ef1-599d-4877-be6c-55e85e5a4e41@isocpp.org> <6e15fc38-8be3-4e74-ade9-e25a8d0e0509@isocpp.org>
 <2d16db0e-fb46-4e1f-956f-db3407a6fb4c@isocpp.org> <1381268094.9101.48.camel@sara>
 <CAOpASk7V=1N=BJgrSki2sqbYwOUD2puZCh7RQ_DkkvZJA_2Z5A@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1065_5911945.1381270159049"
X-Trace: ger.gmane.org 1381270158 30722 80.91.229.3 (8 Oct 2013 22:09:18 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 8 Oct 2013 22:09:18 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCXLLRHD7IDRBEEF2KJAKGQEYBD3IBA@isocpp.org Wed Oct 09 00:09:23 2013
Return-path: <std-proposals+bncBCXLLRHD7IDRBEEF2KJAKGQEYBD3IBA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f198.google.com ([209.85.214.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCXLLRHD7IDRBEEF2KJAKGQEYBD3IBA@isocpp.org>)
	id 1VTfT0-0003S3-5N
	for gclcip-std-proposals@m.gmane.org; Wed, 09 Oct 2013 00:09:22 +0200
Original-Received: by mail-ob0-f198.google.com with SMTP id va2sf4839760obc.5
        for <gclcip-std-proposals@m.gmane.org>; Tue, 08 Oct 2013 15:09:21 -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=gX+wZCKWeheiQKiPCaAncKjC4JnGASV2UXCcVreSv9M=;
        b=Gvu5hawVL54+3Pz5xjHhFWeXXPGxbqYlsC312g7GMnxSbUHQrNX9WKh0mI68xlY69p
         Rz3jMOp1VvqjxRzU1Tu4SLA0uqGZDa22aZ6goDbmehQvZK6Sq/iVjGEWflDcgGwW1obu
         zci3WXJGsyymIOkQtFOimBnKOn46GuID0C57tGufzthJWWKcmCj6H9W3wCHzGKaEWzp4
         wFP50/PWw1FsKIQ65HeE84siMBjiDYSLL0rw9snV/STWaMGfN2McFimN4Q3cGzmEovUo
         M9lAGNH41+gcI5R3cDlXRz/cJ7KsgGLSTRbUtptm37X+a0732svyfRiQGjwI7xSh1eXR
         5qgw==
X-Received: by 10.43.151.16 with SMTP id kq16mr2163797icc.22.1381270161124;
        Tue, 08 Oct 2013 15:09:21 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.43.133 with SMTP id w5ls3843728igl.19.canary; Tue, 08 Oct
 2013 15:09:20 -0700 (PDT)
X-Received: by 10.50.80.78 with SMTP id p14mr183582igx.6.1381270160218;
        Tue, 08 Oct 2013 15:09:20 -0700 (PDT)
In-Reply-To: <CAOpASk7V=1N=BJgrSki2sqbYwOUD2puZCh7RQ_DkkvZJA_2Z5A@mail.gmail.com>
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:7200
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7200>

------=_Part_1065_5911945.1381270159049
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

As I pointed already I think that it would be enough to have only one=20
algorithm because you always can get the negation of a predicate at least=
=20
using lambda expressions.
=20
As for the name then it should be consistent with names of similar by logic=
=20
algorithms.
=20
"if" in the name points out that a predicate is used. At present it is a=20
general approach of naming algorithms with a predicate in the C++ Standard.

=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., 1:59:05 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:

> I agree with Evgeny for the use of "while" and "until" instead of=20
> "first_if". I think they are more intuitive and make more sense.
>
> Concerning the return_type, it's true that std::pair is already used for=
=20
> several component in the library and the algorithm shouldn't throw away a=
=20
> useful information like the first not counted iterator.
>
>
> 2013/10/8 Magnus Fromreide <ma...@lysator.liu.se <javascript:>>
>
>> On Tue, 2013-10-08 at 13:56 -0700, Vlad from Moscow wrote:
>> > I want to change the name in the context of my proposal of
>> > std::accumulate_first_if that there will be a common name for such
>> > types of algorithms.
>> >
>> > By the way using std::find_if with a predicate resolves the two tasks:
>> > returning the count and the last iterator.
>>
>> If we should change the names then I think the best name would be
>>
>> distance_first_if
>>
>> since it is about the distance from one point to another in a range, and
>> the end point is defined as the first entry matching a predicate.
>>
>> (I also think the bikeshed should be pink)
>>
>> /MF
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to a topic in the=
=20
>> Google Groups "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this topic, visit=20
>> https://groups.google.com/a/isocpp.org/d/topic/std-proposals/bXrQrkBw59c=
/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to=20
>> std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> Visit this group at=20
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
>
>

--=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_1065_5911945.1381270159049
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>As I pointed already I think that it&nbsp;would be&nb=
sp;enough to have only one algorithm because you always can get&nbsp;the ne=
gation of a predicate at least using lambda expressions.</div><div>&nbsp;</=
div><div>As for the name then it should be consistent&nbsp;with names of si=
milar by logic algorithms.</div><div>&nbsp;</div><div>"if" in the name poin=
ts out&nbsp;that a predicate is used. At present it is a general approach o=
f naming algorithms with a predicate in the C++ Standard.</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 2=
013&nbsp;=D0=B3., 1:59:05 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"><div=
><div>I agree with Evgeny for the use of "while" and "until" instead of "fi=
rst_if". I think they are more intuitive and make more sense.<br><br></div>=
Concerning the return_type, it's true that std::pair is already used for se=
veral component in the library and the algorithm shouldn't throw away a use=
ful information like the first not counted iterator.<br>

</div></div><div><br><br><div class=3D"gmail_quote">2013/10/8 Magnus Fromre=
ide <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obf=
uscated-mailto=3D"rb3tv2luN-sJ">ma...@lysator.liu.se</a>&gt;</span><br><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-l=
eft: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; bo=
rder-left-style: solid;">

<div>On Tue, 2013-10-08 at 13:56 -0700, Vlad from Moscow wrote:<br>
&gt; I want to change the name in the context of my proposal of<br>
&gt; std::accumulate_first_if that there will be a common name for such<br>
&gt; types of algorithms.<br>
&gt;<br>
&gt; By the way using std::find_if with a predicate resolves the two tasks:=
<br>
&gt; returning the count and the last iterator.<br>
<br>
</div>If we should change the names then I think the best name would be<br>
<br>
distance_first_if<br>
<br>
since it is about the distance from one point to another in a range, and<br=
>
the end point is defined as the first entry matching a predicate.<br>
<br>
(I also think the bikeshed should be pink)<br>
<span><font color=3D"#888888"><br>
/MF<br>
</font></span><div><div><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to a topic in the Goog=
le Groups "ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
a/isocpp.org/d/topic/std-proposals/bXrQrkBw59c/unsubscribe" target=3D"_blan=
k">https://groups.google.com/a/<wbr>isocpp.org/d/topic/std-<wbr>proposals/b=
XrQrkBw59c/<wbr>unsubscribe</a>.<br>


To unsubscribe from this group and all its topics, send an email to <a href=
=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"rb3tv2luN-sJ">s=
td-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"rb3tv2luN-sJ">std-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/<wbr>isocpp.or=
g/group/std-<wbr>proposals/</a>.<br>
</div></div></blockquote></div><br></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_1065_5911945.1381270159049--

.
