220 30282 <f39b3dd8-538e-4b84-8548-a9dc7e3f592a@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Bengt Gustafsson <bengt.gustafsson@beamways.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: P0298: A byte type definition: with undefined
 pointer arithmetic?
Date: Thu, 5 Jan 2017 02:45:41 -0800 (PST)
Lines: 78
Approved: news@gmane.org
Message-ID: <f39b3dd8-538e-4b84-8548-a9dc7e3f592a@isocpp.org>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2888_1589656938.1483613141860"
X-Trace: blaine.gmane.org 1483613152 9747 195.159.176.226 (5 Jan 2017 10:45:52 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 5 Jan 2017 10:45:52 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCRIRSPDTQIRBVWHXDBQKGQED3X7IEA@isocpp.org Thu Jan 05 11:45:44 2017
Return-path: <std-proposals+bncBCRIRSPDTQIRBVWHXDBQKGQED3X7IEA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f69.google.com ([209.85.214.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCRIRSPDTQIRBVWHXDBQKGQED3X7IEA@isocpp.org>)
	id 1cP5YB-00016D-7p
	for gclcip-std-proposals@m.gmane.org; Thu, 05 Jan 2017 11:45:39 +0100
Original-Received: by mail-it0-f69.google.com with SMTP id b123sf485805570itb.3
        for <gclcip-std-proposals@m.gmane.org>; Thu, 05 Jan 2017 02:45:43 -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
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=G4fecXRFWkWC1jonGDSNqXKZnlShu23KZUzRNKKDp0k=;
        b=x0PmAlMJUE14unrm2LgajCOkEZ2xDpB+8drUruy0RnD/KNZ5j44Pl8K18NyzUP6PRa
         +wHLB/PYy7ytHSt6rlhJMhK8jeC/HrniX/jB+Jnw17zXxCRKxXbNigL4dLW/jSrhe8Ot
         2uUql93hYpZaRn31OELuNlhZ54C7cM7ZDpSoTaKj1F5P1BHJag2XEhkyilpcK6s3/SMa
         bVvviB/5isBoxbDmteqNokb/KKHIvjeMhDDSpVnSWo/TTF6cXDILFlgmOGWsPvgkZnEn
         iDPRl/F7j9Z6bDZZyGtrGngYd0wbZtTFzcM5t76Q9gsbHOJg8SCfNrwTg9WboOjJTOc1
         t/Mw==
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=G4fecXRFWkWC1jonGDSNqXKZnlShu23KZUzRNKKDp0k=;
        b=TT4c5eEeYxCE/KB3yWamrm5bOggGeiE+AqaLfc2W19ZkosXPtPvO6iGUICboZfxdoj
         7Ot5d1r2t1wwLBNtEgwhiNMeihfUuepWqXhqHhgfDvxT96g4Kf2mWGo9u+Db4rJlsbod
         1UlNLmLKonaQqsVDoCWI16tu6Xn72uFHaBspPlipnkYfhO3eK2Yc27PfsKNaszb7BFQD
         NTgnsvbUrvDNfJ3fdk4R2Pn3r3ESiNxLRqtb6zFHTeqFNO+ZTcKfiwOHXjSqWJdc84GO
         vS0h9BDHA8yRGo6u/D0G83Rj7Ag7jNDfO4GOT9yLyIGqT8RoAYyCNxKMbSra0EdR448k
         CdtA==
X-Gm-Message-State: AIkVDXLdPHxUzYC2tjBYadEraUQBqD5nO5z/MHXjPz9o+PDPSFKPQzwvm1a8jJS5YJZb0A==
X-Received: by 10.107.0.7 with SMTP id 7mr19643824ioa.100.1483613143357;
        Thu, 05 Jan 2017 02:45:43 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.18.246 with SMTP id g109ls3984181otg.7.gmail; Thu, 05 Jan
 2017 02:45:42 -0800 (PST)
X-Received: by 10.157.14.183 with SMTP id 52mr602102otj.20.1483613142354;
        Thu, 05 Jan 2017 02:45:42 -0800 (PST)
In-Reply-To: <CACGiwhG5mz25RMcPR10YR-D+HcSThhhfE6kJORXDf3WoR64qPQ@mail.gmail.com>
X-Original-Sender: bengt.gustafsson@beamways.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:30282
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30282>

------=_Part_2888_1589656938.1483613141860
Content-Type: multipart/alternative; 
	boundary="----=_Part_2889_1247348354.1483613141860"

------=_Part_2889_1247348354.1483613141860
Content-Type: text/plain; charset=UTF-8

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.

Den onsdag 4 januari 2017 kl. 21:33:27 UTC+1 skrev D. B.:
>
> Indeed, that's pretty much what I would like... not for selfish reasons 
> anymore, since the design where I thought I needed that had *worse* UB 
> that I had to resolve ;-) but simply because it makes sense, makes the 
> "sequence" concept at all useful, and means that the so-called special 
> properties of char* pointers can actually exist.
>
> But when I (thought I) needed this before, it was a fairly simple 
> situation where an object would have a method invoked on it, taking a 
> pointer to one of its members, and was then supposed to calculate the 
> offset of that member within itself and do stuff with it. That hardly seems 
> unreasonable.
>

-- 
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/f39b3dd8-538e-4b84-8548-a9dc7e3f592a%40isocpp.org.

------=_Part_2889_1247348354.1483613141860
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<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=
 alignment?<div><br></div><div>As byte is defined as an enum with a unsigne=
d char as underlying type pointer arithmetic should be defined as expected:=
 to be bytewise. I don&#39;t think this requires specific mention in the st=
andard text.<br><br>Den onsdag 4 januari 2017 kl. 21:33:27 UTC+1 skrev D. B=
..:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Indeed=
, that&#39;s pretty much what I would like... not for selfish reasons anymo=
re, since the design where I thought I needed that had <i>worse</i> UB that=
 I had to resolve ;-) but simply because it makes sense, makes the &quot;se=
quence&quot; concept at all useful, and means that the so-called special pr=
operties of char* pointers can actually exist.<br><br></div>But when I (tho=
ught I) needed this before, it was a fairly simple situation where an objec=
t would have a method invoked on it, taking a pointer to one of its members=
, and was then supposed to calculate the offset of that member within itsel=
f and do stuff with it. That hardly seems unreasonable.<br></div>
</blockquote></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/f39b3dd8-538e-4b84-8548-a9dc7e3f592a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f39b3dd8-538e-4b84-8548-a9dc7e3f592a=
%40isocpp.org</a>.<br />

------=_Part_2889_1247348354.1483613141860--

------=_Part_2888_1589656938.1483613141860--

.
