220 40253 <CAFdMc-3H6mrTgVNDe2ZGXmQ4WV9UQNv-EijJh=HnGHHHL7fh5w@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Daniel Gutson <danielgutson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::between ?
Date: Fri, 28 Sep 2018 11:53:21 -0300
Lines: 312
Approved: news@gmane.org
Message-ID: <CAFdMc-3H6mrTgVNDe2ZGXmQ4WV9UQNv-EijJh=HnGHHHL7fh5w@mail.gmail.com>
References: <7b85d688-9013-407d-b7d3-10d28494e960@isocpp.org>
 <CAFdMc-36tAQ1JJxYOz3PEKv1qnGs=WPGN3NWWKCEwY+SgNdDXA@mail.gmail.com>
 <b917d650-33b0-459d-bba0-c0f03bc4db8d@isocpp.org> <CAFdMc-2=92DEL46jYrGPwESnUkwbYdrrWs=SfL3woc9A4H+6jQ@mail.gmail.com>
 <52d6bd1b-4afb-4f16-adde-8ee8b5ba1041@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="00000000000091b2870576ef9eac"
X-Trace: blaine.gmane.org 1538146288 17640 195.159.176.226 (28 Sep 2018 14:51:28 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 28 Sep 2018 14:51:28 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDE3NBMV6UFBB3UAXHOQKGQEIPW576Q@isocpp.org Fri Sep 28 16:51:24 2018
Return-path: <std-proposals+bncBDE3NBMV6UFBB3UAXHOQKGQEIPW576Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lj1-f198.google.com ([209.85.208.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDE3NBMV6UFBB3UAXHOQKGQEIPW576Q@isocpp.org>)
	id 1g5u71-0004U5-TP
	for gclcip-std-proposals@m.gmane.org; Fri, 28 Sep 2018 16:51:23 +0200
Original-Received: by mail-lj1-f198.google.com with SMTP id 9-v6sf1833384lju.15
        for <gclcip-std-proposals@m.gmane.org>; Fri, 28 Sep 2018 07:53:34 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1538146414; cv=pass;
        d=google.com; s=arc-20160816;
        b=A0TmThrrGK0AXcokYoKwWCnH1bA4Gij3gXUTKxvuZKj1ULvSz5lJEMwneo23i2PJEK
         xI9loC+15N34ihXqn0cJpYC/wCTcamDzY3U4a9VtC60u2TgU8JXFoLuPYQ6CvsV38W3a
         b6zcAzf57PImhFikK1g8hDE/PbX//g1WKIzzryyjqhZAyo/jjE8nh/H1BVQ4V/QZqqqg
         0fbDds7EpHROfiekYG/qywRozsWxrRU8KkTspqw0n8kyGNM0lm8Eki7K+XzHC9k4A1Pq
         I+4luDttY6b4jLgwQUchItzgkWajK4BALXUaq6Li6wZlbCz2aq6iSq+OnaFUCSepexYP
         Hj/w==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:in-reply-to:references:mime-version:dkim-signature;
        bh=WTnKdolRTHMM3xwlx8OUMZBsH7gk2zos3dlEUCWPYKc=;
        b=saNRTFBeQkgI7+Q8xAU7cL3AqDE21I3AXiSHxxZPmgOJuzjamTfWae90RfyYC1Tuw9
         o5UzS0/k+cy6ekHraNJ5XVzt+53ZvjWIFrznVcKHP0mJRCrZioH79U/My6yNCK0psIip
         G4lRhQvfUIrFT9W8b4rAaj4QhI8Ii8kHGTozi0+ad3KE97FBhs0KSqCiV/UULSntVWCK
         LabE9ArRGI6+qAdJDdVELVwnbtlyTuoWFoCKjgESWYzs5wv+Tf+TYgXxOQHWmrPLoI99
         Y9tIHxvlnQZeFvZgeWO2ezlSH5exGuczHW9QRHhegIfGnQLEzQ+8uKryz1eIThZhZAP5
         L3YQ==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=NEWVlvd8;
       spf=pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=danielgutson@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=WTnKdolRTHMM3xwlx8OUMZBsH7gk2zos3dlEUCWPYKc=;
        b=QMaSb8T/kglYzHVDDGKta9SeCMWREKQGH1buCL5UKCYfFuMIHzGu7yapzu3jqOwI7K
         Q2wMUUu1EXDPyMmE8dlMo0oXC3cB0oOWdmY01d/sU+uCnmKakndGvWAzYMHEFN/xmawR
         +rzW7TyGeClKBobBENaF3tSjh6YiTOKnUyhdOLELx4XbvL21R27FVjtp/JQpn2TgluN8
         B+kcAk3LzW/JBi4/H0glzpSJKAMQE9vbO2g4lYJgjzgRj1YbtyKZJsn36Ab4oeKSatEE
         pJnFjP5gnpnlGIzDfbZ84JDs9/cPIylOtTlE29/69ylF+PYs26/wR57kQ85w5hPQR/nN
         tCDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=WTnKdolRTHMM3xwlx8OUMZBsH7gk2zos3dlEUCWPYKc=;
        b=KQPBqwdH344jfFYccmCfl5WbeiEDgms9Ic82pGh8GhulDfttg/hXzOiBAUzcxMV7At
         pgKuuV0jlt0Xy1mMHdtRxRWh+6occWDkz4AGmKxvIVSBkWbCyxu+gYaDtTHYSYRPuR2g
         HWllSvSOQNtht7TXnw7y4uoWl4zuiF+kWfbliaRYpW+dN3FEYoihoUgIrGMeNXAK8l/0
         +ySWJxv68KIldVJ9hiR5Mbg6CzpeG3pZBZKUrY3bc/BMKQH4rptrbWL2ylTnJYDVRB+0
         nG4U4upLzeGVxTIewTDtK/Zm6+CodzwU7JySGI8AoE5d37xsRHb0QirG9mxjNDSlWfm/
         OlNQ==
X-Gm-Message-State: ABuFfoj8kzwHmZHjzBX0Ar3din1Yn91MqXx2RTZnFA418SjW3yM/aLoE
	n76Fk3Te/P7TK8KnQz2ZtsJApg==
X-Google-Smtp-Source: ACcGV61amGCmLDeIEIQ9xAB3ifzCuy0euYdYpG1+jTX2zV4YQWSWEMOPj8xZ/VeqpoMWl+C2hIN3vw==
X-Received: by 2002:a19:ef06:: with SMTP id n6-v6mr513159lfh.13.1538146414842;
        Fri, 28 Sep 2018 07:53:34 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a2e:6354:: with SMTP id x81-v6ls1068662ljb.15.gmail; Fri, 28
 Sep 2018 07:53:33 -0700 (PDT)
X-Received: by 2002:a2e:4a12:: with SMTP id x18-v6mr11565134lja.109.1538146413874;
        Fri, 28 Sep 2018 07:53:33 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1538146413; cv=none;
        d=google.com; s=arc-20160816;
        b=q0ehjHYuidCBdIu4G8WVDMjPtMeQtP51mB+iLJR7ZG4LOFFhEThoSHFUhy9gXqN0lE
         69Nr1k1S7QZD6BxJVmVR5thkwiSKbAxq9L+x1v+fo20B6TKZQH3t9SpmaCqclGuuSTJd
         zT1fK708uUb0SMDlxvyvDg/ISe/lfW+XivyCiI56f+MBa/iPSx8Ds12xqDXr01rmf5fC
         NqRa2bchWn8Uvf02d2md1H+xm8HZy2APMppQP1n6AnDXzd9hOb+sO95R/QHLL3mbB4LP
         RnuPqw9XU3nCp39864qUptNTyl2RwnqZ9paq8idUE6BXggItbuDpSm4m6kJvxM1Wx0iG
         zUYA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature;
        bh=3lzD3Kf3BB84TgtmZ+mKMUGToxVU7FwNhMzHaCRZXFE=;
        b=trX1aWfvnWpvcU8mB4ORJquaRid5E//nPVgjAx0ekwXqkSSyKCHJZNu6jWcSsCsLVD
         qpGd7KF8eSr2hRtX0vk7Ysmhf6AXHr0tP+7mgPh9fEWj5dmbKh9o7Qv3TtexASe2SqEz
         DmA/lsSqpS1uXD6TyMOQuQFUNcIakJy4SIekljfYg5zPbx/ODTlOdCti/R52FAPlKjAn
         iXvg/Re6scvuvufD7DvXl35ozqosErRP62ANl0i10K63u4uVg6CpHptzHK4xyO7F+2lt
         qkH6YgynfsVCFNYMSYguUUEN3FU6PulVqI+PYUssSzagwSnUZJgwFjSirKEjwRJAXYv4
         4xoQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=NEWVlvd8;
       spf=pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=danielgutson@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id j4-v6sor1328595lji.26.2018.09.28.07.53.33
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Fri, 28 Sep 2018 07:53:33 -0700 (PDT)
Received-SPF: pass (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a2e:9a93:: with SMTP id p19-v6mr102200lji.87.1538146413161;
 Fri, 28 Sep 2018 07:53:33 -0700 (PDT)
In-Reply-To: <52d6bd1b-4afb-4f16-adde-8ee8b5ba1041@isocpp.org>
X-Original-Sender: danielgutson@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=NEWVlvd8;       spf=pass
 (google.com: domain of danielgutson@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=danielgutson@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:40253
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40253>

--00000000000091b2870576ef9eac
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

El vie., 28 de sep. de 2018 a la(s) 11:40, Adrian H (
adrian.hawryluk@gmail.com) escribi=C3=B3:

>
>
> On Friday, September 28, 2018 at 10:31:57 AM UTC-4, Daniel Gutson wrote:
>>
>>
>>
>> El vie., 28 sept. 2018 11:26, Jack Adrian Zappa <adrian....@gmail.com>
>> escribi=C3=B3:
>>
>>>
>>>
>>> On Friday, September 28, 2018 at 7:03:19 AM UTC-4, Daniel Gutson wrote:
>>>>
>>>> I stepped into this too many times.
>>>> One of the issues are the four < vs <=3D combinations.
>>>>
>>>> The way I solved is by creating a temporal object that allows chain
>>>> comparison, and a cast-to-bool operator.
>>>>
>>>> if (chain(3) < x < 4)
>>>>
>>>
>>> So, something similar to the solution I provided?  As I said, that
>>> solution would probably result in possible unnecessary comparisons (no
>>> logical short circuiting)
>>>
>>
>> No, the chain object contains a boolean and the last right hand operand
>> as its only state. It should do nothing after the boolean becomes false.
>>
>
> Could you provide your solution?  I'd be interested in finding out how yo=
u
> dealt with short circuiting.
>

Sure, I'm in a conference but I will do later.


> Also, I take it that your solution wouldn't allow comparisons of differen=
t
> types such as a double and a float, or would it convert all objects to th=
e
> type of first one chained?
>

Both the chain class and the comparison operators are templates. The result
of the operator is a new (temporal) chain object with the template argument
deduced. Let me provide the code later.


>
>
>> and additional storage for bool propagation (though I've not looked at
>>> what the optimizer would do).  Would prolly be better to implement in t=
he
>>> language to avoid those issues, even if it is only syntactic sugar, as =
it
>>> can make the code more readable.
>>>
>>>
>>>>
>>>>
>>>> El jue., 27 de sep. de 2018 a la(s) 12:53, Addy (acl...@gmail.com)
>>>> escribi=C3=B3:
>>>>
>>>>> I do this pattern often:
>>>>>
>>>>> if (0 < x && x < 100)
>>>>>
>>>>> And would love a simple `std::between()` that would take two argument=
s
>>>>> and an optional third (compare function) argument.
>>>>>
>>>>> Similar to this: https://gist.github.com/martinmoene/9410391
>>>>>
>>>>> templated<typename T, typename Compare>
>>>>> bool std::between(T lower, T upper, Compare comp)
>>>>> {
>>>>>     return comp(lower) && comp(upper);
>>>>> }
>>>>>
>>>>> Does anything like this exist? Should I propose it!?
>>>>>
>>>>> --
>>>>> 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, sen=
d
>>>>> an email to std-proposal...@isocpp.org.
>>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7b85d688=
-9013-407d-b7d3-10d28494e960%40isocpp.org
>>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7b85d68=
8-9013-407d-b7d3-10d28494e960%40isocpp.org?utm_medium=3Demail&utm_source=3D=
footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>> --
>>>> Who=E2=80=99s got the sweetest disposition?
>>>> One guess, that=E2=80=99s who?
>>>> Who=E2=80=99d never, ever start an argument?
>>>> Who never shows a bit of temperament?
>>>> Who's never wrong but always right?
>>>> Who'd never dream of starting a fight?
>>>> Who get stuck with all the bad luck?
>>>>
>>> --
>>> 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 email to std-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/b917d650-3=
3b0-459d-bba0-c0f03bc4db8d%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/b917d650-=
33b0-459d-bba0-c0f03bc4db8d%40isocpp.org?utm_medium=3Demail&utm_source=3Dfo=
oter>
>>> .
>>>
>> --
> 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
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/52d6bd1b-4af=
b-4f16-adde-8ee8b5ba1041%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/52d6bd1b-4a=
fb-4f16-adde-8ee8b5ba1041%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>


--=20
Who=E2=80=99s got the sweetest disposition?
One guess, that=E2=80=99s who?
Who=E2=80=99d never, ever start an argument?
Who never shows a bit of temperament?
Who's never wrong but always right?
Who'd never dream of starting a fight?
Who get stuck with all the bad luck?

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAFdMc-3H6mrTgVNDe2ZGXmQ4WV9UQNv-EijJh%3DHnGHHHL=
7fh5w%40mail.gmail.com.

--00000000000091b2870576ef9eac
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">El vie=
.., 28 de sep. de 2018 a la(s) 11:40, Adrian H (<a href=3D"mailto:adrian.haw=
ryluk@gmail.com">adrian.hawryluk@gmail.com</a>) escribi=C3=B3:<br></div><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br>On Friday, September 2=
8, 2018 at 10:31:57 AM UTC-4, Daniel Gutson wrote:<blockquote class=3D"gmai=
l_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;pad=
ding-left:1ex"><div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><d=
iv dir=3D"ltr">El vie., 28 sept. 2018 11:26, Jack Adrian Zappa &lt;<a rel=
=3D"nofollow">adrian....@gmail.com</a>&gt; escribi=C3=B3:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><br><br>On Friday, September 28, 20=
18 at 7:03:19 AM UTC-4, Daniel Gutson wrote:<blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr">I stepped into this too many times.<div>One of th=
e issues are the four &lt; vs &lt;=3D combinations.</div><div><br></div><di=
v>The way I solved is by creating a temporal object that allows chain compa=
rison, and a cast-to-bool operator.</div><div><br></div><div>if (chain(3) &=
lt; x &lt; 4)=C2=A0</div></div></blockquote><div><br></div><div>So, somethi=
ng similar to the solution I provided?=C2=A0 As I said, that solution would=
 probably result in possible unnecessary comparisons (no logical short circ=
uiting) </div></div></blockquote></div></div><div dir=3D"auto"><br></div><d=
iv dir=3D"auto">No, the chain object contains a boolean and the last right =
hand operand as its only state. It should do nothing after the boolean beco=
mes false.</div></div></blockquote><div><br></div><div>Could you provide yo=
ur solution?=C2=A0 I&#39;d be interested in finding out how you dealt with =
short circuiting.=C2=A0 </div></div></blockquote><div><br></div><div>Sure, =
I&#39;m in a conference but I will do later.</div><div>=C2=A0</div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div>Also, I take it that your solu=
tion wouldn&#39;t allow comparisons of different types such as a double and=
 a float, or would it convert all objects to the type of first one chained?=
=C2=A0</div></div></blockquote><div><br></div><div>Both the chain class and=
 the comparison operators are templates. The result of the operator is a ne=
w (temporal) chain object with the template argument deduced. Let me provid=
e the code later.=C2=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div dir=3D"ltr"><div><br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div dir=3D"auto"><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>and a=
dditional storage for bool propagation (though I&#39;ve not looked at what =
the optimizer would do).=C2=A0 Would prolly be better to implement in the l=
anguage to avoid those issues, even if it is only syntactic sugar, as it ca=
n make the code more readable.</div><div>=C2=A0</div><blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr"><div><br></div></div><br><div class=3D"g=
mail_quote"><div dir=3D"ltr">El jue., 27 de sep. de 2018 a la(s) 12:53, Add=
y (<a rel=3D"nofollow noreferrer">acl...@gmail.com</a>) escribi=C3=B3:<br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">I do this pattern ofte=
n:<div><br></div><div>if (0 &lt; x &amp;&amp; x &lt; 100)</div><div><br></d=
iv><div>And would love a simple `std::between()` that would take two argume=
nts and an optional third (compare function) argument.</div><div><br></div>=
<div>Similar to this:=C2=A0<a href=3D"https://gist.github.com/martinmoene/9=
410391" rel=3D"nofollow" target=3D"_blank">https://gist.github.com/martinmo=
ene/9410391</a><br></div><div><br></div><div>templated&lt;typename T, typen=
ame Compare&gt;</div><div>bool std::between(T lower, T upper, Compare comp)=
</div><div>{</div><div>=C2=A0 =C2=A0 return comp(lower) &amp;&amp; comp(upp=
er);</div><div>}</div><div><br></div><div>Does anything like this exist? Sh=
ould I propose it!?</div></div>

<p></p>

-- <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 rel=3D"nofollow noreferrer">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow noreferrer">std-pr.=
...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7b85d688-9013-407d-b7d3-10d28494e960%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposa=
ls/7b85d688-9013-407d-b7d3-10d28494e960%40isocpp.org</a>.<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
>Who=E2=80=99s got the sweetest disposition?<br>One guess, that=E2=80=99s w=
ho?<br>Who=E2=80=99d never, ever start an argument?<br>Who never shows a bi=
t of temperament?<br>Who&#39;s never wrong but always right?<br>Who&#39;d n=
ever dream of starting a fight?<br>Who get stuck with all the bad luck? </d=
iv>
</blockquote></div>

<p></p>

-- <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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/b917d650-33b0-459d-bba0-c0f03bc4db8d%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposa=
ls/b917d650-33b0-459d-bba0-c0f03bc4db8d%40isocpp.org</a>.<br>
</blockquote></div></div></div>
</blockquote></div>

<p></p>

-- <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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/52d6bd1b-4afb-4f16-adde-8ee8b5ba1041%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/52d6bd1b-4afb-=
4f16-adde-8ee8b5ba1041%40isocpp.org</a>.<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature" data-smartmail=3D"gmail_signature">Who=E2=80=99s=
 got the sweetest disposition?<br>One guess, that=E2=80=99s who?<br>Who=E2=
=80=99d never, ever start an argument?<br>Who never shows a bit of temperam=
ent?<br>Who&#39;s never wrong but always right?<br>Who&#39;d never dream of=
 starting a fight?<br>Who get stuck with all the bad luck? </div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAFdMc-3H6mrTgVNDe2ZGXmQ4WV9UQNv-EijJ=
h%3DHnGHHHL7fh5w%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFdMc-3H6mrTgV=
NDe2ZGXmQ4WV9UQNv-EijJh%3DHnGHHHL7fh5w%40mail.gmail.com</a>.<br />

--00000000000091b2870576ef9eac--

.
