220 35592 <2a757acd-d7c7-490a-ac59-b590847940f6@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: zxuiji@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Rotational shift operator
Date: Wed, 29 Nov 2017 04:04:07 -0800 (PST)
Lines: 131
Approved: news@gmane.org
Message-ID: <2a757acd-d7c7-490a-ac59-b590847940f6@isocpp.org>
References: <69593098-e2cc-487e-bd14-9001b27aa7c1@isocpp.org> <15ffde291c8.2731.fb49792bc380c7e55e30f872b414f11c@gmail.com> <c890405e-9fc3-43c4-88f1-2be3d74e6407@isocpp.org>
 <5165011.87BksPkTSX@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_19923_752179541.1511957047263"
X-Trace: blaine.gmane.org 1511957050 20461 195.159.176.226 (29 Nov 2017 12:04:10 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 29 Nov 2017 12:04:10 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCLLB64Y44NBBOGE7LIAKGQEP4KIOVQ@isocpp.org Wed Nov 29 13:04:05 2017
Return-path: <std-proposals+bncBCLLB64Y44NBBOGE7LIAKGQEP4KIOVQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f71.google.com ([209.85.213.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCLLB64Y44NBBOGE7LIAKGQEP4KIOVQ@isocpp.org>)
	id 1eK15u-0004sX-Oe
	for gclcip-std-proposals@m.gmane.org; Wed, 29 Nov 2017 13:04:02 +0100
Original-Received: by mail-vk0-f71.google.com with SMTP id s127sf689366vkf.13
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 Nov 2017 04:04:10 -0800 (PST)
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=P4pZuU7W8mZH+ZbDm7FtU+G5BpO8jLbbinA4mdGW/qU=;
        b=VFf+XFU6HKG3aaCMGWbLtHgoBgzWc8GXC+jIWj0RD6UcyghlqexbZeCWZUKeDTVbYI
         qcSCu9mvQmPRocEK5apvFpSDrntfme/ABXCfVeNj06ox+c0nvATD9ij/o4h0QUD5DBvb
         /akGBtmNhGu5RNyMYAXik9N42DrJpMJheSvj6iAm08/3gwGDUFidw02/tyYoorXg9/ZL
         uu3imVblNKRfauzPNDbRtM3xglUuysNHkxk30j9npFv14RES+x0pqC7rzThNfZeQlEA3
         /i1fvksdhKbdUkAlou320ASLF1t5UszyFVGStFgzpYKYE+TVv1TzOOwfZU+0esG2hNaL
         ULvQ==
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=P4pZuU7W8mZH+ZbDm7FtU+G5BpO8jLbbinA4mdGW/qU=;
        b=VKqqkUQaui3ddc50PfFBzyHVgzNLzzCrvt2IKNXvrnobKc8Ktj4zrmGTjci6i9zXYO
         p77tQxn2QlQHM5U7q+NUX/26Y0gIPHHiirhC7rDz8sBFFqXN301u7BFOZMxNF+c/MN66
         8rgz7IIcBLzSJkUdbeZm3eB9WTK2KFh1bkRBgUXRXjYG2PPII7LU4IYpisAQshobuthB
         akga17aVYyCjiq+O7UyslIMjHRaDGDgh1thZTmfVyIQpYN/JGW9YS5BxTo5x0vMrwv9i
         zYy5uiIpVDmf3p9CcOuFXJOe6OWzyUh4FChUnxV9qj2iv1n7nUIMhjfP0x6h16SqyyMS
         bzLA==
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=P4pZuU7W8mZH+ZbDm7FtU+G5BpO8jLbbinA4mdGW/qU=;
        b=d85Nen8TK6XLlLkHfZh3x8tTqagsJrqpnKzcXo4aFIh02B4GgaDrROdL+icAhXgGmC
         vxvF8V30/RzesICJ4GLY8G72BclTz3unkmOR+oHN5I2dN2AtDUTlQSaxXYepeoP2BQtp
         kdlQCBZBInFkDM/smesxtacDKdOu4c3xnjqwPhK8Y12TtFiGmbHkW3QzLtVp/Y46s9rL
         oA0SS5mjegDsW02XDpXk6q6G8SgitMeIXW9IyG09NUr1JwqhdFtrvuY1oKO9cU0KlnUE
         kRc1BP/y344OnbXfA+eztF4L6sKcZds7ekuHLF1h6VqLC5CHefxa3hz5WKMCnBxNFGLb
         KR+Q==
X-Gm-Message-State: AJaThX6mQh7Nb5dDrc4noTRfha51Lc0gO9euy2HVm3Xb+9fyFbJESLHL
	RcI1SVEUd8sXFlAWJLqyoSd7VQ==
X-Google-Smtp-Source: AGs4zMa16cxTRk2W5boKJv8qecDchK6+huIc+itysTRrcpO/QwQp5nnWiqE/xVHDIPRit5zQ9hTFGw==
X-Received: by 10.31.107.79 with SMTP id g76mr1166438vkc.88.1511957049954;
        Wed, 29 Nov 2017 04:04:09 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.176.72.48 with SMTP id b45ls4466847uad.2.gmail; Wed, 29 Nov
 2017 04:04:08 -0800 (PST)
X-Received: by 10.31.2.148 with SMTP id 142mr145888vkc.1.1511957048054;
        Wed, 29 Nov 2017 04:04:08 -0800 (PST)
In-Reply-To: <5165011.87BksPkTSX@tjmaciei-mobl1>
X-Original-Sender: zxuiji@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:35592
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/35592>

------=_Part_19923_752179541.1511957047263
Content-Type: multipart/alternative; 
	boundary="----=_Part_19924_392042206.1511957047263"

------=_Part_19924_392042206.1511957047263
Content-Type: text/plain; charset="UTF-8"

On Wednesday, 29 November 2017 05:41:38 UTC, Thiago Macieira wrote:
>
> https://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Min-and-Max.html 
>
> Deprecated, though. 
>

What about the @ character? Any issues with that?

On Wednesday, 29 November 2017 05:41:38 UTC, Thiago Macieira wrote: 

>
> > I read further down about how pow() should have it's own operator, the 
> > immediate thought I had there was maybe ** & **= would work, old 
> compilers 
> > which aren't supposed to support the new standard would just fail to 
> > compile it anyway. As for the rotl/rotr thing I only don't like them 
> > because of A: how 1 needs to cast to be sure they get the part of the 
> > integer they want when they use it, neither can they be sure the bits 
> > rotate in the same way they would rotate on smaller/larger integer (e.g. 
> > 0x1 becoming 0x80000000 instead of 0x80) & B: One cannot apply the 
> rotation 
> > directly to the integer they are working with (like how "a += 1" is 
> faster 
> > than "a = a + 1") 
>
> Faster to type, but not to execute. 
>
> But I did not understand your reason for not liking. What cast is 
> necessary? 
> Can you give an example where using rotl without a cast would result in a 
> surprise or incorrect result? 
>

rotl is not necessarily going to be a macro to operator usage, it can be a 
function using int/long/long long which means it falls to us to ensure the 
result not only that we receive is safe to place in the target variable but 
also the operation was done the way we would expect it to for the integer 
size we are working with.
 

-- 
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/2a757acd-d7c7-490a-ac59-b590847940f6%40isocpp.org.

------=_Part_19924_392042206.1511957047263
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, 29 November 2017 05:41:38 UTC, Thiago Maciei=
ra  wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><a href=3D"https://g=
cc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Min-and-Max.html" target=3D"_blank" rel=
=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q\=
x3dhttps%3A%2F%2Fgcc.gnu.org%2Fonlinedocs%2Fgcc-3.4.2%2Fgcc%2FMin-and-Max.h=
tml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGvXq0c7fhdiHEfVebXCz71QzC2cQ&#3=
9;;return true;" onclick=3D"this.href=3D&#39;https://www.google.com/url?q\x=
3dhttps%3A%2F%2Fgcc.gnu.org%2Fonlinedocs%2Fgcc-3.4.2%2Fgcc%2FMin-and-Max.ht=
ml\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGvXq0c7fhdiHEfVebXCz71QzC2cQ&#39=
;;return true;">https://gcc.gnu.org/<wbr>onlinedocs/gcc-3.4.2/gcc/Min-<wbr>=
and-Max.html</a>
<br>
<br>Deprecated, though.
<br></blockquote><div><br></div><div>What about the @ character? Any issues=
 with that?</div><div><br></div><div>On Wednesday, 29 November 2017 05:41:3=
8 UTC, Thiago Macieira wrote:=C2=A0</div><blockquote class=3D"gmail_quote" =
style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-l=
eft: 1ex;">
<br>&gt; I read further down about how pow() should have it&#39;s own opera=
tor, the
<br>&gt; immediate thought I had there was maybe ** &amp; **=3D would work,=
 old compilers
<br>&gt; which aren&#39;t supposed to support the new standard would just f=
ail to
<br>&gt; compile it anyway. As for the rotl/rotr thing I only don&#39;t lik=
e them
<br>&gt; because of A: how 1 needs to cast to be sure they get the part of =
the
<br>&gt; integer they want when they use it, neither can they be sure the b=
its
<br>&gt; rotate in the same way they would rotate on smaller/larger integer=
 (e.g.
<br>&gt; 0x1 becoming 0x80000000 instead of 0x80) &amp; B: One cannot apply=
 the rotation
<br>&gt; directly to the integer they are working with (like how &quot;a +=
=3D 1&quot; is faster
<br>&gt; than &quot;a =3D a + 1&quot;)
<br>
<br>Faster to type, but not to execute.
<br>
<br>But I did not understand your reason for not liking. What cast is neces=
sary?=20
<br>Can you give an example where using rotl without a cast would result in=
 a=20
<br>surprise or incorrect result?
<br></blockquote><div><br></div><div>rotl is not necessarily going to be a =
macro to operator usage, it can be a function using int/long/long long whic=
h means it falls to us to ensure the result not only that we receive is saf=
e to place in the target variable but also the operation was done the way w=
e would expect it to for the integer size we are working with.</div><div>=
=C2=A0</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/2a757acd-d7c7-490a-ac59-b590847940f6%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2a757acd-d7c7-490a-ac59-b590847940f6=
%40isocpp.org</a>.<br />

------=_Part_19924_392042206.1511957047263--

------=_Part_19923_752179541.1511957047263--

.
