220 37537 <CAA7YVg1ZHes2s7mMGqGAgh0JTrNOq0gHmSNFgdRJo6yOb78Q-Q@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Viacheslav Usov <via.usov@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Allowing std::complex's magic permission for
 other types
Date: Wed, 28 Mar 2018 17:41:04 +0200
Lines: 102
Approved: news@gmane.org
Message-ID: <CAA7YVg1ZHes2s7mMGqGAgh0JTrNOq0gHmSNFgdRJo6yOb78Q-Q@mail.gmail.com>
References: <a3462649-a7bd-4215-b162-e8fe922df02d@isocpp.org>
 <p9c1k7$h28$1@blaine.gmane.org> <e85dfb30-f3ff-4769-90d2-373efceda1e6@isocpp.org>
 <CAA7YVg2n1N_QrxC09Er4vLr+ebwQ5GhkD-3isND76d4YJHwC0g@mail.gmail.com>
 <018c02d9-7c65-4451-acc1-c49196fc7622@isocpp.org> <CAA7YVg1Tt-hwYej80qK_Cr2RxvBtP3aM+EZ7gqC4RKz6z9aGPw@mail.gmail.com>
 <1e25a8ae-4752-4fc0-8c89-639cef53121c@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="000000000000c1678605687ad548"
X-Trace: blaine.gmane.org 1522251544 10874 195.159.176.226 (28 Mar 2018 15:39:04 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 28 Mar 2018 15:39:04 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDU6VRPKW4BBBEXP53KQKGQEEFK3EDA@isocpp.org Wed Mar 28 17:39:00 2018
Return-path: <std-proposals+bncBDU6VRPKW4BBBEXP53KQKGQEEFK3EDA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f199.google.com ([209.85.192.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDU6VRPKW4BBBEXP53KQKGQEEFK3EDA@isocpp.org>)
	id 1f1DAB-0002j6-NR
	for gclcip-std-proposals@m.gmane.org; Wed, 28 Mar 2018 17:39:00 +0200
Original-Received: by mail-pf0-f199.google.com with SMTP id k16sf1607981pfi.7
        for <gclcip-std-proposals@m.gmane.org>; Wed, 28 Mar 2018 08:41:07 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1522251667; cv=pass;
        d=google.com; s=arc-20160816;
        b=ndJ0rNJGfXSiErQPJuPsGgtkuIz/6e/LCbRGDSFJOomOkCc84KXXSZn27DxLZk1ckq
         MEeGCiefF8wMmVr+3EvxD/web3g3t473qGv9EkhRYLGJaw1i855hTBbO4k9aNZ+5o3xU
         pxiTPjpkrkz52zP/BE+Z0lx5jcB2MyG6SJbUnJJmX1BQRieDcytwZY8zUl8CyrUJH3OI
         rk14sFj5LzaV+QgZVp+PD0fkDMsxfMW0dcvQvGXNsTfBMJU/JzuQFhirUS0IyxEX2PLK
         kjRbPMQMPPHIfj30WHeHLGQLlQqWeHHhtX3yPsV9S5p7dblGqRI9G0lvhyaM7jcE7km7
         4fYA==
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:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=DiKSGZSz4+TUe3706uVv8qz44ixm+Src1PsQSZlOfq8=;
        b=lHDbc4TmMUWU5hdSYKY0iVMTek0AYZRsqyDeo/lr5sp49tOQrgFdhj06rg2YR9QmDD
         bzm/TWsX8TW4lIGYdX8mXdGPjiFORi5+AV2yY/XpD5JwgKcbZcJlkhPvpS03BFyzgnHP
         6IwsHYFqyiwn7mgx99vc/4cQ27PMdnIcYfHN2BDvMyeG80PL04UhHpOw+7ODnrNjoE2p
         jpoYbDzDJ4meSx+JOorLaqpDIIdOL14O1FeLs4S5T1Dadowncmf33Z+CFyNt+S19AO5l
         HRyzYNbS/T1wIJ34/LH8kGo2uuM4ouWAtcqBJKT67CgAS2qN/Ja+Na2fUsGF7VLzo9nn
         7hlQ==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=VFZNamvY;
       spf=pass (google.com: domain of via.usov@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=via.usov@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=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:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=DiKSGZSz4+TUe3706uVv8qz44ixm+Src1PsQSZlOfq8=;
        b=mfHUgdV8BNERtRE4IwjjzWVIFKIK62E8oJBkLW7wOXxcQ0YInEARYCu0+270dtrJXE
         7GpAMX+MHWLt+hJmsv8agnCqmBYTGMFv8zBBrqfQpgxEjGfZHt0UHhJgxV0uLkJtyj7+
         x5nDs50X5vmwJSlM1/qzdG/rnHgSQpa/81LRzMGm57csYHVGguVyqOo9bCozP0YmmuNY
         NNiXIQ3/cx/93iOKuM2qexOYErLvrVPZakyzVdNXUfNLMn6DjfhkB8wEHv38ga4TR0ae
         rOqIgnV6pYPCzkaIPzpGWx2zqAWkaL37Wl9qhby924glh2XpUTVj6KqqWZMFw2Zg8/s/
         wxqQ==
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=DiKSGZSz4+TUe3706uVv8qz44ixm+Src1PsQSZlOfq8=;
        b=N8LLo+H+GbbNCx32T+ajK2MuBg7zNAimGNkxr6COoJL1jV+A+JmRFFBw+kz+gh1sj+
         Ej1hAl68LBQ5JjVdhKgv+C9M5BWpDZCEc5KbSUJXxb6Y2Sk11hJY5f9G/xFxOgIl9jXf
         YaofKh4lcMpQDcadndkZvqrHada/aqMgN+7+ssBa0sVsxB06+yw6vrZs61N1loaaU7Il
         tClgq8eemme5XVcYfEAdKgpLBzIWEzS7ItLGhoMbY4EtDb51LjAbO+2gwM7gfQUk2ShT
         7u91R0eyA4h6aiehMcdcgdrf3nIRKDhuDLpA+cz7x7O7gCPUb5aCeF+ajnpZos1VtcrN
         liKA==
X-Gm-Message-State: AElRT7HKtKh5V3VkE6mU4dYpbjmu1dY4j19r271dCOkOcCF/2ijADDlx
	0UbVatl/TWvRMjRqj27utBnwIQ==
X-Google-Smtp-Source: AIpwx490BgsHH1hj4td+r3TS3aOGdRGwrJuA8SUsFshjkr1IpFuRCQbPVhKRfQ5RaruXF6aaXWBiCA==
X-Received: by 10.167.129.208 with SMTP id c16mr2652798pfn.32.1522251666964;
        Wed, 28 Mar 2018 08:41:06 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.101.83.142 with SMTP id x14ls306486pgq.0.gmail; Wed, 28 Mar
 2018 08:41:05 -0700 (PDT)
X-Received: by 10.99.111.6 with SMTP id k6mr2911101pgc.444.1522251665636;
        Wed, 28 Mar 2018 08:41:05 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1522251665; cv=none;
        d=google.com; s=arc-20160816;
        b=swypZZpkB+WENxnbRqO1iZC37c4vRC6gsKasB6JCCgYmmAkg+iA+8sDaDPJ4gTjNKM
         UH3sEqiGUI5OBImoToUk709rswE7bMkIDy9VZkdG4HZVWKQavVJoRpicNFkXtCruqBnO
         JbuBxansXaVCw1RcULfYb36nI18dT0GuPCePobV7pIcHmdnhliNHIdZg/qKu81VHUDqA
         colWhBtqv2ubX7uhhG1rixUNo2gT4qP7xHQtCVA8m+dyhWPTxJpapprW6QY8L5obxQzQ
         LLRJmh4fOqHNC7u1fecg4SZJP/UPbC7QB0YILlvsPTKvq1IAF/W7F+oXvGFFFgaoofF+
         3gyQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=vmiKxZi/LG9oecRnYfRvJ9GhY1Sd62KoDeglcr71Vbo=;
        b=Y6LxovDnPbW2igJgvfcpzqi490/DMjyDY0T73X0GO5vNpxTVVSkBsFjgFKAurKWRkb
         hdZ6QT0TcUVksqD9y3Y9n+9BAskx6u6JOqTng2DA7A4kFrFceu0D5sXkw30kUyBvl+q5
         TPyAmZH1bvNcomR923SwL6BwSDb/6xa+UURJaft3/9wk7SyOJFWsjBBLRsisM8FU/+EV
         HU6NqGtc6bG0NGxissS0d+cRdi/rWE5pyzObAoi6XQfld/GpjS0VWdtxB1nBBCvg543x
         e7sMV56cBfEZM+sofRHy01opwvE8FxfibJ7AthBfwIrQjl54Fw7FE6QDrW8vOanfvPnb
         Ow3w==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=VFZNamvY;
       spf=pass (google.com: domain of via.usov@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=via.usov@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id t10-v6sor1860611plh.91.2018.03.28.08.41.05
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Wed, 28 Mar 2018 08:41:05 -0700 (PDT)
Received-SPF: pass (google.com: domain of via.usov@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a17:902:8481:: with SMTP id c1-v6mr4248568plo.304.1522251665072;
 Wed, 28 Mar 2018 08:41:05 -0700 (PDT)
Original-Received: by 10.236.175.138 with HTTP; Wed, 28 Mar 2018 08:41:04 -0700 (PDT)
In-Reply-To: <1e25a8ae-4752-4fc0-8c89-639cef53121c@isocpp.org>
X-Original-Sender: via.usov@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=VFZNamvY;       spf=pass
 (google.com: domain of via.usov@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=via.usov@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:37537
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37537>

--000000000000c1678605687ad548
Content-Type: text/plain; charset="UTF-8"

On Wed, Mar 28, 2018 at 4:42 PM, Edward Catmur <ed@catmur.co.uk> wrote:

> bar[2] is well-defined, but it refers to the past-the-end element of
foo[0], which cannot be accessed. It does not refer to foo[1][0], although
it has the same address.

What does "not refer to" mean, exactly, given that "it has the same
address", and, obviously, the same type, to which  [basic.compound]/3.4
"Pointers to layout-compatible types shall have the same value
representation and alignment requirements" trivially applies?

Are you saying that by doing

auto baz = reinterpret_cast<int*>(&foo[1][0]);

and then by doing (bar + 2) == baz you might encounter undefined behaviour
or get that evaluated as false, or, if not, that bar[2] is
undefined behaviour while baz[0] is not?

Cheers,
V.

-- 
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/CAA7YVg1ZHes2s7mMGqGAgh0JTrNOq0gHmSNFgdRJo6yOb78Q-Q%40mail.gmail.com.

--000000000000c1678605687ad548
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 W=
ed, Mar 28, 2018 at 4:42 PM, Edward Catmur <span dir=3D"ltr">&lt;<a href=3D=
"mailto:ed@catmur.co.uk" target=3D"_blank">ed@catmur.co.uk</a>&gt;</span> w=
rote:<br><div><br></div><div>&gt; bar[2] is well-defined, but it refers to =
the past-the-end element of foo[0], which cannot be accessed. It does not r=
efer to foo[1][0], although it has the same address.</div><div><br></div><d=
iv>What does &quot;not refer to&quot; mean, exactly, given that &quot;<span=
 style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;=
font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;fo=
nt-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-t=
ransform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,=
255,255);text-decoration-style:initial;text-decoration-color:initial;float:=
none;display:inline">it has the same address&quot;, and, obviously, the sam=
e type, to which=C2=A0=C2=A0</span>[basic.compound]/3.4=C2=A0 &quot;Pointer=
s to layout-compatible types shall=C2=A0have the same value representation =
and alignment requirements&quot; trivially applies?</div><div><br></div><di=
v>Are you saying that by doing</div><div><br></div><div>auto baz =3D

<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:1=
2.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:nor=
mal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;=
text-transform:none;white-space:normal;word-spacing:0px;background-color:rg=
b(255,255,255);text-decoration-style:initial;text-decoration-color:initial;=
float:none;display:inline">reinterpret_cast&lt;int*&gt;(&amp;foo[1]</span><=
span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12=
..8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:norm=
al;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;t=
ext-transform:none;white-space:normal;word-spacing:0px;background-color:rgb=
(255,255,255);text-decoration-style:initial;text-decoration-color:initial;f=
loat:none;display:inline"><wbr>[0]);</span>

</div><div><span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;=
font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-varia=
nt-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-=
indent:0px;text-transform:none;white-space:normal;word-spacing:0px;backgrou=
nd-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-col=
or:initial;float:none;display:inline"><br></span></div><div><span style=3D"=
font-size:12.8px">and then by doing (bar + 2) =3D=3D baz you might encounte=
r=C2=A0<span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font=
-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-c=
aps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-inde=
nt:0px;text-transform:none;white-space:normal;word-spacing:0px;background-c=
olor:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:i=
nitial;float:none;display:inline">undefined=C2=A0behaviour</span>

 or get that evaluated as false, or, if not, that bar[2] is undefined=C2=A0=
behaviour while baz[0] is not?</span></div><div><span style=3D"font-size:12=
..8px"><br></span></div><div>Cheers,</div><div>V.</div></div></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/CAA7YVg1ZHes2s7mMGqGAgh0JTrNOq0gHmSNF=
gdRJo6yOb78Q-Q%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAA7YVg1ZHes2s7mM=
GqGAgh0JTrNOq0gHmSNFgdRJo6yOb78Q-Q%40mail.gmail.com</a>.<br />

--000000000000c1678605687ad548--

.
