220 30293 <CACGiwhE9c+cgwrp0mVutjoxC7kP5OvH_zoLtOj7fLcNq_h3xHg@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "D. B." <db0451@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: P0298: A byte type definition: with undefined
 pointer arithmetic?
Date: Thu, 5 Jan 2017 12:08:32 +0000
Lines: 76
Approved: news@gmane.org
Message-ID: <CACGiwhE9c+cgwrp0mVutjoxC7kP5OvH_zoLtOj7fLcNq_h3xHg@mail.gmail.com>
References: <e21a1901-1ed5-5795-6244-dd70c4d08adf@f2.dion.ne.jp>
 <CACGiwhER_fU=bVY0nob5Tap9s=APgmeFS6sx6HQfnoPEKJjDVg@mail.gmail.com>
 <db74f34b-b0ab-46cb-b94a-eeb96ef10c2d@isocpp.org> <CACGiwhG5mz25RMcPR10YR-D+HcSThhhfE6kJORXDf3WoR64qPQ@mail.gmail.com>
 <f39b3dd8-538e-4b84-8548-a9dc7e3f592a@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b86e2f893198b054557c27d
X-Trace: blaine.gmane.org 1483618117 16774 195.159.176.226 (5 Jan 2017 12:08:37 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 5 Jan 2017 12:08:37 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCWNZ4ECS4GBBQPOXDBQKGQEWNBNRAA@isocpp.org Thu Jan 05 13:08:33 2017
Return-path: <std-proposals+bncBCWNZ4ECS4GBBQPOXDBQKGQEWNBNRAA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f70.google.com ([209.85.215.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCWNZ4ECS4GBBQPOXDBQKGQEWNBNRAA@isocpp.org>)
	id 1cP6qL-0003Yd-LL
	for gclcip-std-proposals@m.gmane.org; Thu, 05 Jan 2017 13:08:29 +0100
Original-Received: by mail-lf0-f70.google.com with SMTP id d16sf149699460lfb.7
        for <gclcip-std-proposals@m.gmane.org>; Thu, 05 Jan 2017 04:08:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references: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=2asgxdMykUNmILQ8+1J6BLoa0mmWO8ERL2hJ8nT741s=;
        b=ucTFQN8bCAqKLyDTOG10SDRjsU+r+7CT0h72hCRKQiZr2ztA6QCyx+S3Hfq7s2kx3W
         A4osi7Ct20H8OQtjJ+6tqU3s6qJpfV+SL1SpSDhVSajP9QzQf5XpORifEk63yoDbl80T
         /v6GhMlVj6GkSwhRy8xEMgRj4nZuUft4E3CjgNooFuntaMDApWJtt2ljEM1k6qiOz83m
         iDjYMB7odun+V40JjKMpgTmWrOk8+PY5IuZFLyKEXo+k16cPjAdLNooZnTgyvdpaGe2j
         UJeaIYzA1vxSiL2aoE01SS6enkg+X+mEC3eik5mnXOSskozGFB9YJWGw9u7saZh7bI+e
         UohQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references: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=2asgxdMykUNmILQ8+1J6BLoa0mmWO8ERL2hJ8nT741s=;
        b=cpB//VAjyyTy7K4vs9/y8xwwviERix1Q4CsqBReZqJujIFg7WVeRK52pbT+/4i41Lx
         vmfc5ckz6q75CqFyL3yJjnm3/kco9qJc1zeNhpsyT98Irpgq/XpvhNOuTJhd+uCRQ9K6
         +fL8wyc6f3Li6RkArarVCaxD9gXkas3ZHLM3FWV09/h/1WDu4D94TaPZ3TlwFDocuUsl
         a8cNjVF2uAvNSnqKJcid+UTEBjtOimeZSr/mfj3phAml19hhetd9XloPZwSqaLIMChuq
         GPXlXIkPXjTOdYEp91xYf0D+MWZ+gs11u06NxeYYRt3MPB2Nhfm2aKXAJDFzFTAmC8lY
         mNCw==
X-Gm-Message-State: AIkVDXIyp0w2gOmwV51SdKlRMYAQrBhC1GjZD62a6z+yrWZXgAG7jgQaPjfjRVdzUaIOoQ==
X-Received: by 10.46.74.25 with SMTP id x25mr5958960lja.31.1483618114284;
        Thu, 05 Jan 2017 04:08:34 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.69.202 with SMTP id l71ls4873609wmi.27.gmail; Thu, 05 Jan
 2017 04:08:32 -0800 (PST)
X-Received: by 10.194.31.201 with SMTP id c9mr60318559wji.176.1483618112816;
        Thu, 05 Jan 2017 04:08:32 -0800 (PST)
Original-Received: from mail-wj0-x230.google.com (mail-wj0-x230.google.com. [2a00:1450:400c:c01::230])
        by mx.google.com with ESMTPS id k7si714749wjz.57.2017.01.05.04.08.32
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 05 Jan 2017 04:08:32 -0800 (PST)
Received-SPF: pass (google.com: domain of db0451@gmail.com designates 2a00:1450:400c:c01::230 as permitted sender) client-ip=2a00:1450:400c:c01::230;
Original-Received: by mail-wj0-x230.google.com with SMTP id ew7so19710922wjc.3
        for <std-proposals@isocpp.org>; Thu, 05 Jan 2017 04:08:32 -0800 (PST)
X-Received: by 10.194.60.195 with SMTP id j3mr63616945wjr.149.1483618112443;
 Thu, 05 Jan 2017 04:08:32 -0800 (PST)
Original-Received: by 10.28.144.66 with HTTP; Thu, 5 Jan 2017 04:08:32 -0800 (PST)
In-Reply-To: <f39b3dd8-538e-4b84-8548-a9dc7e3f592a@isocpp.org>
X-Original-Sender: db0451@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of db0451@gmail.com
 designates 2a00:1450:400c:c01::230 as permitted sender) smtp.mailfrom=db0451@gmail.com;
       dmarc=pass (p=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:30293
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30293>

--047d7b86e2f893198b054557c27d
Content-Type: text/plain; charset=UTF-8

On Thu, Jan 5, 2017 at 10:45 AM, Bengt Gustafsson <
bengt.gustafsson@beamways.com> wrote:

> I can't say that I have checked but isn't an array of enum values
> equivalent to its underlying type when it comes to size and alignment?
>
> As byte is defined as an enum with a unsigned char as underlying type
> pointer arithmetic should be defined as expected: to be bytewise. I don't
> think this requires specific mention in the standard text.
>

It's worse than that! The problem is that char* itself does not seem to be
allowed to have the special properties it supposedly has, for reading other
objects as a "sequence" o char*, because it is formally undefined to
increment that pointer to the next byte in the "sequence". The linked issue
is an attempt to clarify what this nebulous "sequence" really is and
whether (or why not) it is equivalent to an *array* for the purposes of
indexing/arithmetic.

So if char* isn't allowed to do these things, std::byte won't be,
regardless of any transitive properties it gets from other facets of the
Standard.

-- 
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/CACGiwhE9c%2Bcgwrp0mVutjoxC7kP5OvH_zoLtOj7fLcNq_h3xHg%40mail.gmail.com.

--047d7b86e2f893198b054557c27d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
hu, Jan 5, 2017 at 10:45 AM, Bengt Gustafsson <span dir=3D"ltr">&lt;<a href=
=3D"mailto:bengt.gustafsson@beamways.com" target=3D"_blank">bengt.gustafsso=
n@beamways.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
 dir=3D"ltr">I can&#39;t say that I have checked but isn&#39;t an array of =
enum values equivalent to its underlying type when it comes to size and ali=
gnment?<div><br></div><div>As byte is defined as an enum with a unsigned ch=
ar as underlying type pointer arithmetic should be defined as expected: to =
be bytewise. I don&#39;t think this requires specific mention in the standa=
rd text.<span class=3D""></span> <br></div></div></blockquote></div><br></d=
iv><div class=3D"gmail_extra">It&#39;s worse than that! The problem is that=
 char* itself does not seem to be allowed to have the special properties it=
 supposedly has, for reading other objects as a &quot;sequence&quot; o char=
*, because it is formally undefined to increment that pointer to the next b=
yte in the &quot;sequence&quot;. The linked issue is an attempt to clarify =
what this nebulous &quot;sequence&quot; really is and whether (or why not) =
it is equivalent to an <i>array</i> for the purposes of indexing/arithmetic=
..<br><br></div><div class=3D"gmail_extra">So if char* isn&#39;t allowed to =
do these things, std::byte won&#39;t be, regardless of any transitive prope=
rties it gets from other facets of the Standard.<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/CACGiwhE9c%2Bcgwrp0mVutjoxC7kP5OvH_zo=
LtOj7fLcNq_h3xHg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhE9c%2Bcg=
wrp0mVutjoxC7kP5OvH_zoLtOj7fLcNq_h3xHg%40mail.gmail.com</a>.<br />

--047d7b86e2f893198b054557c27d--

.
