220 35631 <0a5bfe0d-0bdd-6f87-c49f-a6691963a8ff@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Andrey Semashev <andrey.semashev@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Rotational shift operator
Date: Thu, 30 Nov 2017 01:07:03 +0300
Lines: 42
Approved: news@gmane.org
Message-ID: <0a5bfe0d-0bdd-6f87-c49f-a6691963a8ff@gmail.com>
References: <69593098-e2cc-487e-bd14-9001b27aa7c1@isocpp.org>
 <1660240.TqYmd56DvC@tjmaciei-mobl1>
 <659853f7-4d67-4cbc-4632-1a7cfc532f44@gmail.com>
 <1971370.BddXmUsGWe@tjmaciei-mobl1>
 <dc1405cd-22e8-7f04-0d0a-0063d2203103@gmail.com>
 <CAHSYqdbqK9Uk4-K+OwvU9=mLUdi_1zP82fZjj0Skp3qz0gWYfw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1511993223 12211 195.159.176.226 (29 Nov 2017 22:07:03 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 29 Nov 2017 22:07:03 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.4.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCXY5TXHWYJRBCO77TIAKGQEZCTJIVA@isocpp.org Wed Nov 29 23:06:58 2017
Return-path: <std-proposals+bncBCXY5TXHWYJRBCO77TIAKGQEZCTJIVA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f72.google.com ([209.85.215.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCXY5TXHWYJRBCO77TIAKGQEZCTJIVA@isocpp.org>)
	id 1eKAVO-0002o0-FP
	for gclcip-std-proposals@m.gmane.org; Wed, 29 Nov 2017 23:06:58 +0100
Original-Received: by mail-lf0-f72.google.com with SMTP id z130sf1101501lff.18
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 Nov 2017 14:07:06 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1511993226; cv=pass;
        d=google.com; s=arc-20160816;
        b=DsdUMjXWZQQr84TA6c0wSvir5JMuBu48o7o3qkBKZBSYwGRYKUqwRQZcDCxcCF95xu
         XNA9R1NkyxPdCc97FSdwNZMXaaXhb5qySkAb6Qjk9B9wvzPNVO6f28pOnQJl3l9W6TRJ
         vrsop+1N3ILAEg3+66/K7RA8GO0X6tSQgCNa/qHBcYRlEp76RLgTzOm5NJ3RJD/AgIJz
         wex18DAqyIp4SXIRGFdruEDvupcvvfXQqNKi54G4Y3P4nCoDzVWjYVZcXG0V2hM0nbrk
         j64i2mlxNoPra1fUsW+WNVLzhiI5sJHxFqS1eUfDH5nAfMeLpCl0f0mGAMLmDxIu5Q4w
         qrVA==
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:content-transfer-encoding
         :content-language:in-reply-to:mime-version:user-agent:date
         :message-id:from:references:to:subject:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=bQA9cHOuwOnMTkxY7rgqrd9xph6APbqiT1xcUKkVJgA=;
        b=Vt8s3PGPwuvlolBEx2ITDTtC6anerltt7l1z0qRBzjo25iyioBxtXTOL3CXEcRPupM
         f5iAKN2fYUoefekF16K3yOK2wwEtRiWr9LdOsr+SLT8/jxn4O0JfylhzyukBM0q2VXgQ
         kuAy0S4qde/+U1ToKXcTtN9U6AEga6eBEcV1n1xMM42kscVvFtJKQJpiclFSyBablYez
         0lLuG7GQKeUwyFGB2SF6hFO5zNCoS74uBu3NMD8mZjyxRdDTrkndLYWs2ZSloCOjDMi3
         qORBVT/sxSdHxj9/7tTsqtnQU+KlCdmQhszC2m+V3ZauN7e8BECDe60uMFKvFK 
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=a2xXnZl4;
       spf=pass (google.com: domain of andrey.semashev@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andrey.semashev@gmail.com;
       dmarc=pass (p=NONE sp=NONE 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=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to:content-language:content-transfer-encoding
         :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=bQA9cHOuwOnMTkxY7rgqrd9xph6APbqiT1xcUKkVJgA=;
        b=MPMvJmq3k5w6yiXw63QOygaMG8vL3M94ytVnwEAR9Hsia/dh6nrAldI2S09z35flND
         O7E6R57cQuGBwuzHvTB1yhDF4vGai4ms2s07kFRWDK2PKAzJqbyZtHQZtkrAC+T2baCp
         SD9qIsRQQBCDGPmTXme/3FZHSDPb47LGBRmGpn7bij6c9Zzd2C0EYVOQx8kXYnwRXQDh
         VvD3Zau+k2H6X8tpc7roYpFupws+M/syjbptn21H8AxGaQRa3Zw/pr4Xs1gv5lMVrlxh
         e3GXDTj30A6IrQgD9X2qo+TAdUhrMBSPADQrSViUhfHglmqdWJFXRIACD8cWxrE0sa3S
         C5H 
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-language
         :content-transfer-encoding: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=bQA9cHOuwOnMTkxY7rgqrd9xph6APbqiT1xcUKkVJgA=;
        b=L1vFr5lR/SgALrRBmrbgnPzkjfG0Wahu3nVoImqA7u6WeSbamskZyk5Zc/2KLhisBp
         Z4DQ/QiWnOqsqqUBL0HeVubkwchlH0vIJbYHZmqMjwHRgSqjVEDuMrZLBZmXJnPoETsR
         KZ1Z6gCGgztxs8e/k1GCwrSqkQ2HtFdiL4CK4D6EBafO71YmS9y5SGT9278fvqYFkHGf
         r7uoXRsNwXvDSFFtBJKQTbHsSR1bx4ZJa7EPDs9aVGuOgmNBI4V9oPp3LvKcfSSSt0d8
         lJLAYQLRskaI7fqxMAcZmoXnP/XYsE8cVgOqDSELXlT 
X-Gm-Message-State: AJaThX7UchOeR4pFClRwH7jxOLOsDGItMrLfPt20X5r+/Y+iVyrlT1hM
	F7fAvEbCJoUKefcIknnXccfG5g==
X-Google-Smtp-Source: AGs4zMb/m+gli5qYszvJbSN2YU9XFncjLljRrAASE89vm2QEaUph51XNqQxg5thqMDBWm9V70mNISQ==
X-Received: by 10.46.22.20 with SMTP id w20mr178139ljd.38.1511993226062;
        Wed, 29 Nov 2017 14:07:06 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.46.109.2 with SMTP id i2ls1626231ljc.14.gmail; Wed, 29 Nov
 2017 14:07:05 -0800 (PST)
X-Received: by 10.46.64.76 with SMTP id n73mr2336243lja.33.1511993225038;
        Wed, 29 Nov 2017 14:07:05 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1511993225; cv=none;
        d=google.com; s=arc-20160816;
        b=xAdBdJhyB6d4VSpH4XhodQQn8YML4DH14F6cWcybP7yOrNZkT0oEWWAd++Bmddv7pM
         IlQg11nTRGWpKkPvHlFjIIr8DTEBYl3Cm9FbvFkJ4umS8NWsbbqJotIH2nVhX+D4qQ9n
         D3B+3zmnIRGUdmwfCOrhjmuXCjIP96kC2oob2EOpGXIHkZ0nyDt60JSpHE5E05HfRx5y
         /ianTeUFcyE9ukEzNwALriuOdsEsrBM/w0MW7ohuwvz7ys4LB98vbz1484gy8SWk+amp
         XNnm2EFmwa8h2bdFAyx8aRtzvTxW4P36y9Vcgqjt7ShQD9SCYx29ddA9FU2ixIlpMltQ
         osOA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:from:references:to:subject
         :dkim-signature:arc-authentication-results;
        bh=IltKRHPfMZXts/9qlIyVH8JFB19bY7PVUJW4Ir+a2Nw=;
        b=dNiknqhFOjMvsGlrFQBofhDhwUg12myFETvfcXXRASrgMDbCbCRb3vbGaesSLXkrIz
         AKUQyZkGnFG6fErhhYV664ImueHQavPLRkO/POIlwqvtRe5Wja77zsMIRqoTN/sFaa3S
         qQk9dodlvm9DqbhMO6mDfhvsZ8i9jO+oiol9hhpPDejpSFKeuY6xkDNIYsPpPYEO/9KB
         ntWnFtByFJC0T6/PZoAPQpGRTgbslrquFZxzfvWjLzHsiT5Qf9MwyikvJ1RuhxUato8Q
         U1KJ8Vzu5mWcGWTHve1Q5bJjIupbR5gW0ZZtnFZq1yjrKOjlmQMavLsD6xLQH+cDFJmj
         ayzg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=a2xXnZl4;
       spf=pass (google.com: domain of andrey.semashev@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andrey.semashev@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65])
        by mx.google.com with SMTPS id 74sor539040ljc.85.2017.11.29.14.07.04
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Wed, 29 Nov 2017 14:07:05 -0800 (PST)
Received-SPF: pass (google.com: domain of andrey.semashev@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65;
X-Received: by 10.46.32.230 with SMTP id g99mr2064447lji.147.1511993224610;
        Wed, 29 Nov 2017 14:07:04 -0800 (PST)
Original-Received: from [192.168.1.2] (broadband-178-140-150-13.moscow.rt.ru. [178.140.150.13])
        by smtp.googlemail.com with ESMTPSA id p73sm469501lfp.9.2017.11.29.14.07.03
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 29 Nov 2017 14:07:03 -0800 (PST)
In-Reply-To: <CAHSYqdbqK9Uk4-K+OwvU9=mLUdi_1zP82fZjj0Skp3qz0gWYfw@mail.gmail.com>
Content-Language: ru
X-Original-Sender: andrey.semashev@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=a2xXnZl4;       spf=pass
 (google.com: domain of andrey.semashev@gmail.com designates 209.85.220.65 as
 permitted sender) smtp.mailfrom=andrey.semashev@gmail.com;       dmarc=pass
 (p=NONE sp=NONE 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-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:35631
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/35631>

On 11/30/17 00:31, Hyman Rosen wrote:
> On Wed, Nov 29, 2017 at 3:52 PM, Andrey Semashev=20
> <andrey.semashev@gmail.com <mailto:andrey.semashev@gmail.com>> wrote:
>=20
>         Totally valid:
>          =C2=A0 =C2=A0 =C2=A0 =C2=A0 c =3D int(unsigned(a) + unsigned(b))=
;
>=20
>=20
>     No, you can't do that in portable code. Some implementation may trap
>     on conversion overflow,
>=20
>     another may saturate, third may produce bogus results. The fact that
>     each of the three
>=20
>     implementations documented their respective behaviors doesn't help
>     you at all because your code
>=20
>     doesn't work.
>=20
>=20
> This is not exactly right.=C2=A0=C2=A0[conv.integral] says
>=20
> /If the destination type is signed, the value is unchanged if it can be=
=20
> represented in the destination type;/
> /otherwise, the value is implementation-defined.
> /
> So this code is not allowed to trap.=C2=A0 It must produce a value.

Right. It may produce a trapping value, though. Still, my point remains.

--=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/0a5bfe0d-0bdd-6f87-c49f-a6691963a8ff%40gmail.com=
..

.
