220 17670 <1ef428e1-8d12-4fd7-9852-62429c50a2eb@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: Overloading the family of minmax algorithms
Date: Fri, 1 May 2015 08:14:40 -0700 (PDT)
Lines: 147
Approved: news@gmane.org
Message-ID: <1ef428e1-8d12-4fd7-9852-62429c50a2eb@isocpp.org>
References: <558876f0-141f-49ca-bece-7215ec173d1d@isocpp.org> <4A07A10E-B668-447F-A6FA-776D6C3BD7D5@gmail.com> <f967abc1-2415-47f1-aba3-8fbb8df60a75@isocpp.org>
 <4D8B3545-2BEC-4A40-891F-9D92E35BABA4@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1135_1373702123.1430493280365"
X-Trace: ger.gmane.org 1430493283 22097 80.91.229.3 (1 May 2015 15:14:43 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 1 May 2015 15:14:43 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCXLLRHD7IDRBYNQR2VAKGQEDLDUWJY@isocpp.org Fri May 01 17:14:43 2015
Return-path: <std-proposals+bncBCXLLRHD7IDRBYNQR2VAKGQEDLDUWJY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f199.google.com ([209.85.217.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCXLLRHD7IDRBYNQR2VAKGQEDLDUWJY@isocpp.org>)
	id 1YoCeI-0001z2-EN
	for gclcip-std-proposals@m.gmane.org; Fri, 01 May 2015 17:14:42 +0200
Original-Received: by lbbqq2 with SMTP id qq2sf26079740lbb.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 01 May 2015 08:14:42 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type:x-original-sender:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=9RJriiPbwXIA8DGs0fU9n7cEPBel+sQCAZTxAbewb9k=;
        b=SkBUB/H9JbEUlT9oSQoOsCra7QuIht2Ya8DfU2zBH9bdiFW9791+fIloIA6cj3Ye25
         gJJUiA4Jjb/l9osT2cXwCl+LIWLOfCZW1LaAQX+Fag6KOCS1dUU96hOMFIsFIdNCRF4A
         Kx5x/4hAZL/AsQcHvz+t58UkyWFHpU6zsHViLU46uM3VDHWIq58/hvUiitKmU4sWMghT
         j/D5ZabW0hvu4ukyByZzfaAlFlJDHbo/zL94BKoOEg9rws/wbbb7kfmIhNGMDvz8p/ee
         Gy1Ify+UpS6i563P4l3H1iugA0jMXiqeozI33M75p8jISdWhy5zzBtT1jhpAkehhrkPd
         XgPw==
X-Gm-Message-State: ALoCoQkQWUX6UuEMbbUQOs788AELlZfHtGusImg2f0NxrHtE01XGEpT/O2jkbNvC8pSVE7kYDxQn
X-Received: by 10.152.8.17 with SMTP id n17mr8279503laa.0.1430493282016;
        Fri, 01 May 2015 08:14:42 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.21.102 with SMTP id 93ls1700159qgk.53.gmail; Fri, 01 May
 2015 08:14:41 -0700 (PDT)
X-Received: by 10.140.102.75 with SMTP id v69mr107478qge.19.1430493280978;
        Fri, 01 May 2015 08:14:40 -0700 (PDT)
In-Reply-To: <4D8B3545-2BEC-4A40-891F-9D92E35BABA4@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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:17670
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/17670>

------=_Part_1135_1373702123.1430493280365
Content-Type: multipart/alternative; 
	boundary="----=_Part_1136_214892364.1430493280365"

------=_Part_1136_214892364.1430493280365
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Friday, May 1, 2015 at 5:51:16 PM UTC+3, David Krauss wrote:
>
>
> > On 2015=E2=80=9305=E2=80=9301, at 10:43 PM, Vlad from Moscow <vlad....@=
mail.ru=20
> <javascript:>> wrote:=20
> >=20
> > the algorithm I proposed does not imply that only predicates I showed=
=20
> are used.=20
>
> Yes, what is the other application?=20
>
> General use of the algorithm is when you are required to find the first=
=20
element that satisfies one predicate and the last element that=20
satisfies another predicate. You can use either these elements themselves=
=20
or use the range they provide for some next operation.

 =20

> > So my algorithm is very flexible  In fact it does not mean for example=
=20
> that the first and last minimum elements are searched It is simply a=20
> partial case of using the algorithm.=20
>
> It=E2=80=99s also about twice as slow as a dedicated algorithm.=20
>

You may write a separate algorithm for any partial case and invent a new=20
name for each such an algorithm but as for me I do not think that it is=20
always a good idea.=20

>
> > It is enough clear because the algorithm is named minmax. So there is n=
o=20
> difference between the order of iterators in the return pair and the orde=
r=20
> of comparators in the parameter of type pair.=20
>
> Given the XOR-like sensibility that min + less =3D min, min + greater =3D=
 max,=20
> max + less =3D max, and max + greater =3D min, the interface makes perfec=
t=20
> sense.


It is enough to know that the first predicate corresponds to the first=20
returned iterator that is close to the beginner of the given sequence and=
=20
that the second predicate corresponds to the second returned iterator that=
=20
is close to the end of the given sequence. You can consider even word min=
=20
as begining and max as end.=20

--=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_1136_214892364.1430493280365
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, May 1, 2015 at 5:51:16 PM UTC+3, David =
Krauss wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px=
 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-le=
ft-width: 1px; border-left-style: solid;">
<br>&gt; On 2015=E2=80=9305=E2=80=9301, at 10:43 PM, Vlad from Moscow &lt;<=
a onmousedown=3D"this.href=3D'javascript:';return true;" onclick=3D"this.hr=
ef=3D'javascript:';return true;" href=3D"javascript:" target=3D"_blank" rel=
=3D"nofollow" gdf-obfuscated-mailto=3D"5MdBNIb8-VEJ">vlad....@mail.ru</a>&g=
t; wrote:
<br>&gt;=20
<br>&gt; the algorithm I proposed does not imply that only predicates I sho=
wed are used.
<br>
<br>Yes, what is the other application?
<br>
<br></blockquote><div>General use of the algorithm is when you are required=
 to find the first element that satisfies one predicate and the last elemen=
t that satisfies&nbsp;another predicate. You can use either these elements =
themselves or use the range they provide for some next operation.</div><div=
><br></div><div>&nbsp;&nbsp;</div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(20=
4, 204, 204); border-left-width: 1px; border-left-style: solid;">&gt; So my=
 algorithm is very flexible &nbsp;In fact it does not mean for example that=
 the first and last minimum elements are searched It is simply a partial ca=
se of using the algorithm.
<br>
<br>It=E2=80=99s also about twice as slow as a dedicated algorithm.
<br></blockquote><div><br></div><div>You may&nbsp;write a separate algorith=
m for any partial case and invent a new name for&nbsp;each such an&nbsp;alg=
orithm but as for me I do not&nbsp;think that it is always a good idea.&nbs=
p;</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8e=
x; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-wi=
dth: 1px; border-left-style: solid;">
<br>&gt; It is enough clear because the algorithm is named minmax. So there=
 is no difference between the order of iterators in the return pair and the=
 order of comparators in the parameter of type pair.=20
<br>
<br>Given the XOR-like sensibility that min + less =3D min, min + greater =
=3D max, max + less =3D max, and max + greater =3D min, the interface makes=
 perfect sense.</blockquote><div><br></div><div>It is enough to know that t=
he first predicate&nbsp;corresponds to the first returned iterator that is =
close to the beginner of the given sequence and that the second predicate c=
orresponds to the second returned iterator that is close to the end of the =
given sequence. You can consider even word min as begining and max as end.&=
nbsp;</div></div>

<p></p>

-- <br />
<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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<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_1136_214892364.1430493280365--
------=_Part_1135_1373702123.1430493280365--

.
