220 33030 <23282d1f-aaaa-45a1-a1fe-2056addfe835@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: federico.kircheis@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: safe integrals comparison
Date: Thu, 29 Jun 2017 10:00:00 -0700 (PDT)
Lines: 77
Approved: news@gmane.org
Message-ID: <23282d1f-aaaa-45a1-a1fe-2056addfe835@isocpp.org>
References: <66f9bab2-7220-4bf1-afb7-77c5efa1bac3@isocpp.org>
 <4473c388-1bc0-24b3-b1f2-fc8bfc834df3@rrsd.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3560_1354070715.1498755600740"
X-Trace: blaine.gmane.org 1498755606 29916 195.159.176.226 (29 Jun 2017 17:00:06 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 29 Jun 2017 17:00:06 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCZ3PBGHYEBBBEPE2TFAKGQED6KFVUI@isocpp.org Thu Jun 29 19:00:01 2017
Return-path: <std-proposals+bncBCZ3PBGHYEBBBEPE2TFAKGQED6KFVUI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f198.google.com ([209.85.161.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCZ3PBGHYEBBBEPE2TFAKGQED6KFVUI@isocpp.org>)
	id 1dQcnN-0007UJ-TJ
	for gclcip-std-proposals@m.gmane.org; Thu, 29 Jun 2017 18:59:58 +0200
Original-Received: by mail-yw0-f198.google.com with SMTP id k18sf72734679ywe.12
        for <gclcip-std-proposals@m.gmane.org>; Thu, 29 Jun 2017 10:00:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        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;
        bh=ZKUp7b8g838gM0fkjaFsegkbA3+J7LhDJx1QA39WK6Y=;
        b=wCf9DqtfpHdCs1o8q0zFLdL9+U6WWv8ucpU60AZ3NEAzu+xTDkMzinOJgnp+89X6lf
         /lotUwCIhD1hZ6qOgRPrkD+Z8dMFDWTg9M41Ma9Z5hrAzEyoPFVdVRm8cCQfpeOi5yRb
         4g8nf13CDR1IOyvzXthB70whN4z+JMy+5NKW8veUOtkrWAafNpP/ywPQlCbNknWft10A
         cDo7DI7WRNdtPhbenZoaMTzzoLrnCQk8njZ6be6R7WPHdjVhSFK1joz76e7eHsproOnO
         VIhVJ/Vy3xXljWZd7PO7+Nk201z6YgcyVhYJwRYIYsDd+j1JUyyzwK8T7EKmfCOZTPV6
         utGQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        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;
        bh=ZKUp7b8g838gM0fkjaFsegkbA3+J7LhDJx1QA39WK6Y=;
        b=iPD+cqdT2McE2jXoKO72mptqL/+3Qe6dFyPS0FrlqGwLMSYWDzcL706NVWr7+wXlRj
         VB1sTUWT/m47j2NHBYLDPwMpGZ+EYUdVjVWkATZKplOThPg8P/jQspmkOgBxb8iwn6TO
         ulUqF2+k9mCd/4NgfKG4p/6x29dl2I/r93ZLTSW21jB4YegLA3NirPgaTJqkaOhTm9ox
         Ori2GohidD9etuAaD7Pdk8efCuPOFrHBtok0Oen6UleE/MftSbz1VcRmb4ghys5NU4pA
         Y/j468t7UhXXKA82WMlrRHFTzSpOjMESnRk2CgPzERlATES7SsThov+y42f3DZECiVzt
         U3hQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=ZKUp7b8g838gM0fkjaFsegkbA3+J7LhDJx1QA39WK6Y=;
        b=oAVql41BWbOXA1upCUKFyQvgtfDrhJGW4fZDYycZBXJAnHN7C2EEQH0+w6DG9Q2LVt
         1xB60Revkz3AlRFkAbcZ9otcnO3NbBWmT9qLKaXshPNh5PmnjQb0yAbSL1ngqm2Zrt0i
         xINd/0ff/HMEO1hhMG7zbFVs3eINXcmsUS9rtXRTRPeZ4UAkNXGXPBd6JlYaX+nhyUpa
         EOIkLfJ1Of4XdINr1Fsp0vpRBp6TMrygmcWrjJVd3+yCc4goPUSBATCcMwkmCw12npPU
         /2sGboiUPpLMEXwk09WQwmn9wh0nv33JV2eJ1uAnKK70boIcQBISnElVq9RaWQwlnoeC
         18RQ==
X-Gm-Message-State: AKS2vOyE5Esb33jukcdVah7pWvQ2+qhTZRWjgWI9wM4krf+Srei60PKR
	cYFv+SjKjkkBpZn5
X-Received: by 10.129.33.130 with SMTP id h124mr10865497ywh.125.1498755602913;
        Thu, 29 Jun 2017 10:00:02 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.51.84 with SMTP id z81ls229619ioz.12.gmail; Thu, 29 Jun
 2017 10:00:01 -0700 (PDT)
X-Received: by 10.36.79.144 with SMTP id c138mr122762itb.2.1498755601431;
        Thu, 29 Jun 2017 10:00:01 -0700 (PDT)
In-Reply-To: <4473c388-1bc0-24b3-b1f2-fc8bfc834df3@rrsd.com>
X-Original-Sender: federico.kircheis@gmail.com
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: <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:33030
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33030>

------=_Part_3560_1354070715.1498755600740
Content-Type: multipart/alternative; 
	boundary="----=_Part_3561_366027867.1498755600740"

------=_Part_3561_366027867.1498755600740
Content-Type: text/plain; charset="UTF-8"

Hi, 

I was just reading your implementation a couple of days ago, it's pretty 
complicated with all those templated types ;-)

(To be honest I found out of your library in March, when I listened to the 
podcast episode, but then forgot to give a look to your implementation)

I noticed you were not comparing the precision of the types like I did, I 
guess I missed that I could use "make_unsigned". 
I think the only difference is that I'm converting both types to the one 
with the biggest range, and accounting that it may be the signed one. I 
guess it may use less stack space, but I also think that it will never make 
some difference.

I guess your implementation for comparing integral types and mine are 
completely interchangeable. 

Maybe I should also add to my proposal the implementation of cmp_greater 
and the others comparator, even if given cmp_less they all trivial.
And surely a link to your repository as possible alternative implementation 
without using a "precision" function.


-- 
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/23282d1f-aaaa-45a1-a1fe-2056addfe835%40isocpp.org.

------=_Part_3561_366027867.1498755600740
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi, <br><br>I was just reading your implementation a coupl=
e of days ago, it&#39;s pretty complicated with all those templated types ;=
-)<br><br>(To be honest I found out of your library in March, when I listen=
ed to the podcast episode, but then forgot to give a look to your implement=
ation)<br><br>I noticed you were not comparing the precision of the types l=
ike I did, I guess I missed that I could use &quot;make_unsigned&quot;. <br=
>I think the only difference is that I&#39;m converting both types to the o=
ne with the biggest range, and accounting that it may be the signed one. I =
guess it may use less stack space, but I also think that it will never make=
 some difference.<br><br><div>I guess your implementation for comparing int=
egral types and mine are completely interchangeable. <br><br>Maybe I should=
 also add to my proposal the implementation of cmp_greater and the others c=
omparator, even if given cmp_less they all trivial.<br>And surely a link to=
 your repository as possible alternative implementation without using a &qu=
ot;precision&quot; function.<br><br><br></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/23282d1f-aaaa-45a1-a1fe-2056addfe835%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/23282d1f-aaaa-45a1-a1fe-2056addfe835=
%40isocpp.org</a>.<br />

------=_Part_3561_366027867.1498755600740--

------=_Part_3560_1354070715.1498755600740--

.
