220 37052 <278b25ca-746e-abca-75b2-3a2b7112eb1a@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Jonathan_M=c3=bcller?= <jonathanmueller.dev@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: More conservative version of P0907 "Signed
 Integers are Two's Complement"
Date: Sat, 24 Feb 2018 19:32:00 +0100
Lines: 52
Approved: news@gmane.org
Message-ID: <278b25ca-746e-abca-75b2-3a2b7112eb1a@gmail.com>
References: <CADvuK0LuUyyHCDhYZ+Ln2iNuj9WH1bfYrfNoRgD06C5wdqW35w@mail.gmail.com>
 <53F0ECAD-6569-42FA-9675-1FB73DFAC6EA@apple.com>
 <CADvuK0+kq5hFWG6UqZyLFOEsPNunLM4zVrn0ym6s05Cf6QGJxw@mail.gmail.com>
 <8467483E-0F95-43B3-B877-FD790A3597A1@apple.com>
 <CADvuK0L+BDk3TMYX6znEe0RMbEPZfYGzEWDLjOXLB60EyR5R6g@mail.gmail.com>
 <CAOfiQqmKqYn_r-9=aPpLsBrwnNO_VFh-tz_6CVMpGRhuOvAbsA@mail.gmail.com>
 <20180224100538.GA2770@noemi>
 <7336dd9a-50af-b7d9-7837-f304cb643c24@gmail.com>
 <17d9f9ec-4d63-416c-a476-3955fd9a702e@isocpp.org>
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 1519497005 6963 195.159.176.226 (24 Feb 2018 18:30:05 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 24 Feb 2018 18:30:05 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.6.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUMHC4Z6QGBBJG7Y3KAKGQEOOAG7LI@isocpp.org Sat Feb 24 19:30:01 2018
Return-path: <std-proposals+bncBCUMHC4Z6QGBBJG7Y3KAKGQEOOAG7LI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f72.google.com ([74.125.82.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUMHC4Z6QGBBJG7Y3KAKGQEOOAG7LI@isocpp.org>)
	id 1epea8-0001LF-Q5
	for gclcip-std-proposals@m.gmane.org; Sat, 24 Feb 2018 19:30:00 +0100
Original-Received: by mail-wm0-f72.google.com with SMTP id 137sf4503757wml.0
        for <gclcip-std-proposals@m.gmane.org>; Sat, 24 Feb 2018 10:32:07 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1519497127; cv=pass;
        d=google.com; s=arc-20160816;
        b=Na0wFjJlDyKsYsvPBlqDStwV6/OdrIKTXhUjuB6+t0KIahkf4u9S50+Bw/sVC49OBS
         Bm50TbAgQrq4liPuziI5R9BKV+MAwzmse/4NiFs4kmJCdDk+SFE6VH6BhBYCQWCy3JJd
         5WKuIfeMs+o/ju8lFjVD5qadbCX9SWjtQWh1QHlQbwteOVh+cgYMvJ0R4tJhGxMO84uN
         k0zTJKObUdKyRmohZpQKhC13NJFQOY28LPS571Qz77LbL5RST49d2ZeS2ccWS0ETjPTo
         1qtnUP1d4O7F9/QRtpgY/c0DflRf2Q2bnBKYAHpkYRW1Bx+/bQE0ESptA+JXlAU8q1jH
         K8eg==
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=8UP3+3PuabIOhzSsLWTCfFS2myXaIEkbA5hib9fEVyo=;
        b=jjYVFYykxEslNvamcDV41LKtE3hMGqyGTEwdJjQ0OSyE0EzSNjsZKTBkdJKsi0LjxM
         3Dmp3sp6FIY/tAYY0vA1p/8tc2Q4ej19A12ZG+wfmZqOY+K3yHZdDKsXydbRSTr2y5DO
         5qH9hh/lBtHR14fpcy6+VWySZIbR8Xf/ub43/BWk+DcmANxyavd4B73rE9nUkpSxRwC9
         OPMpdxH9sPrkFl3C6yoHGWC7v0MaX8I5A5tjPBIwpDtQdZY8qpWYjtm9V07HXc8/Qufq
         6zVKKS8ngzKNON/7lLh3P6ankB+7rggKrdXIlzW28+in2z55So4iSMa1+IchXg 
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=OOTjhSrQ;
       spf=pass (google.com: domain of jonathanmueller.dev@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jonathanmueller.dev@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=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=8UP3+3PuabIOhzSsLWTCfFS2myXaIEkbA5hib9fEVyo=;
        b=scg+MZU+aPmsGOgsCd6X2GrSkBSR6ekPpNT+lwbOF1uWSs9Wplc5/B9sKmrkRq6pom
         26r9IjyvpdYUgHOlTQF41T1w5yYbBLewFnzWQ5YtsTtUxNHl9Ed/afppzASE8LDTZbv8
         RWadJIyCKWIsrR3PMMd5A84j7Tl8KDGv/oIGVVLMe1Dd7tMd+7Ui+0+iGi2Tzdgh1UIZ
         nNouUXsdrsCabpaOnWkxonY9Rw7fRarjjLtr9hSqMk4rx6d/V4GpyQmaks1LuN37/Idx
         wH6MBlUABwBp6ig5l6pgCUGw+d5JXxFFBplAUIQO9nbGvcXPtXNKxYVoR1ldxEbE9PNn
         f46 
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=8UP3+3PuabIOhzSsLWTCfFS2myXaIEkbA5hib9fEVyo=;
        b=U3USr8QxdxTbFThorQ9FvBItSPTbvDstjxPKQAQVW03Zrlnux8aqzmF9n9Fz3TeoXV
         63mJOR4NxLKwa23ESjxyKy8qOxBe8PY1K/LGnbnAYkp0hEtS3tVRRzXnhl1Eq5EaUcUe
         hjxnh3FmxaYzH6hF3JgLn8vHeTzEO9zvwFwpr9GgqblaEUb8a7+Ixu1uPJ6ueW3/Ikex
         VGGVJuCY6BQTZSgsYj0udcEcyGhsImg1mgP+mXnvd8NC6+WMXtMJUMKpLUeukOlGKdbm
         /LQrzWoU9a2br6+HbqJlER5LDNUSYjUL4cUtBHdJ9np 
X-Gm-Message-State: APf1xPAunQLQ1QK0wLwusMZzn7wz5GVKzA7LiLXtK43C7Ypua5tDg6N/
	dQEnFXOdEpRPlxPX5sg5DpY3Bg==
X-Google-Smtp-Source: AH8x226PA81+HLgZc/crVF/adBIhKb/D5Tw9S35odGbKFwRlszP5m3Nn56EdzivE0KqkW7HopdQSnw==
X-Received: by 10.80.200.202 with SMTP id k10mr1485688edh.10.1519497127081;
        Sat, 24 Feb 2018 10:32:07 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.80.158.236 with SMTP id a99ls4637285edf.7.gmail; Sat, 24 Feb
 2018 10:32:03 -0800 (PST)
X-Received: by 10.80.204.133 with SMTP id q5mr7741378edi.112.1519497123754;
        Sat, 24 Feb 2018 10:32:03 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1519497123; cv=none;
        d=google.com; s=arc-20160816;
        b=tvFbHyEMuQjtZ3F6gdP841PvmV9OJOsj3m8Rnrvh/diUFH4H9y/Kw5ksUZ8yhXJdmM
         CtnkN2m9KKnjcR1PTO8b2jm27bYPzFMl5lZfeBxGcIxZ8OFEJtCfIiJVzsAkXdhc7cWT
         G5wSQratriwPCCJgP4ftaGhOiuCLKRdYcCVYH6jeDZj7eWTzyQT7K8kNn52E/ZR0Ugmx
         ERp8r8wXSWEfKzrO7pd1pXeH3Ssw4+LAp1Wx/wiIMO7yV56qvC14a+80xwQlFNeHBfUx
         YKceRHBsnAGnv3YP7KLHpsV+FdKw20dwTebMhRW4hzMBguR3ii5q9yU/qGmC0shFjKNR
         7WyQ==
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=HRqkGsErFe6UloFbKmuUGpdLP6IH7FjV0BYxTPHOmcY=;
        b=AvPYn3kmhscbWZko15ULzIh4X5xFrqN0CrWyluvGCrs/whlGK6Ul9QopBeol34UHkq
         3uZymsxopCCucyE7Ed+G5vRUCiVcviGEteZoiy/FO4BI9wYMk8/sTJh8/HJ6yKSi6ntN
         3wwvBkR2fNbqwFaS3E5NfZNqryGfLFs2uL4pgGbpWjI3CAyqnRxJrZYCYLH/F929FhGZ
         y106cRa5rhI0v9XEdOdML8YjrbY5Fh8NeUFjgetQfCkpEdzc9jo791v29xd+gm40+JAW
         kvVRelyJmPnFkzretGfvM3CnNBUJ6PaS2h9oS13rZeo/MBN2gxOQnIby+28TmU5wR4JP
         gaVg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=OOTjhSrQ;
       spf=pass (google.com: domain of jonathanmueller.dev@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jonathanmueller.dev@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE 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 b36sor2833324ede.7.2018.02.24.10.32.03
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Sat, 24 Feb 2018 10:32:03 -0800 (PST)
Received-SPF: pass (google.com: domain of jonathanmueller.dev@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65;
X-Received: by 10.80.241.83 with SMTP id z19mr7879448edl.104.1519497123361;
        Sat, 24 Feb 2018 10:32:03 -0800 (PST)
Original-Received: from [192.168.1.98] (dslb-084-060-193-203.084.060.pools.vodafone-ip.de. [84.60.193.203])
        by smtp.gmail.com with ESMTPSA id k9sm4046244edh.34.2018.02.24.10.32.02
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 24 Feb 2018 10:32:02 -0800 (PST)
In-Reply-To: <17d9f9ec-4d63-416c-a476-3955fd9a702e@isocpp.org>
Content-Language: en-US
X-Original-Sender: jonathanmueller.dev@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=OOTjhSrQ;       spf=pass
 (google.com: domain of jonathanmueller.dev@gmail.com designates 209.85.220.65
 as permitted sender) smtp.mailfrom=jonathanmueller.dev@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:37052
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37052>

On 24.02.2018 17:47, Nicol Bolas wrote:
>=20
>=20
> On Saturday, February 24, 2018 at 11:08:43 AM UTC-5, Jonathan M=C3=BCller=
 wrote:
>=20
>     Why make it keywords though?
>=20
>=20
> Because otherwise they'd have to be /types/. And the whole point of his=
=20
> suggestion was that they're not different types. There is no such thing=
=20
> as a `wrapped int` type; there's just an `int`, which the compiler will=
=20
> treat as "wrapped".
>=20

But what's the downside of making them types?

I've heard of languages where you have `+` for addition with UB overflow=20
and something like `+%` for addition with modulo. But I don't think it=20
makes that much sense: either you want addition with UB for all addition=20
operations on an object, or modulo for all. The only exception - I can=20
think of - would be in the implementation of an `would_overflow(a, b)`,=20
but there you can cast.

> I think the main advantage of the untyped approach is that it neatly=20
> ducks conversion issues. That is, is the conversion from `wrapped_int`=20
> to `int` like a user-defined conversion, or is it like converting a=20
> `short` to an `int`? How does it behave with overload resolution and=20
> scoring? And so forth.

I don't think you'd need implicit conversion for those at all.
But I'm not a fan of implicit conversion anyway.

> The thing is, we don't really /want/ to treat a wrapped integer as a=20
> different type from `int`. What we /really/ want is to treat an=20
> /expression/ as wrapped or unwrapped.

I disagree, but don't have a strong opinion there.

--=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/278b25ca-746e-abca-75b2-3a2b7112eb1a%40gmail.com=
..

.
