220 37517 <CAA7YVg2n1N_QrxC09Er4vLr+ebwQ5GhkD-3isND76d4YJHwC0g@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 12:34:59 +0200
Lines: 62
Approved: news@gmane.org
Message-ID: <CAA7YVg2n1N_QrxC09Er4vLr+ebwQ5GhkD-3isND76d4YJHwC0g@mail.gmail.com>
References: <a3462649-a7bd-4215-b162-e8fe922df02d@isocpp.org>
 <p9c1k7$h28$1@blaine.gmane.org> <e85dfb30-f3ff-4769-90d2-373efceda1e6@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="000000000000235d610568768f78"
X-Trace: blaine.gmane.org 1522233179 7623 195.159.176.226 (28 Mar 2018 10:32:59 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 28 Mar 2018 10:32:59 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDU6VRPKW4BBBVO75XKQKGQEBMGDRWY@isocpp.org Wed Mar 28 12:32:55 2018
Return-path: <std-proposals+bncBDU6VRPKW4BBBVO75XKQKGQEBMGDRWY@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+bncBDU6VRPKW4BBBVO75XKQKGQEBMGDRWY@isocpp.org>)
	id 1f18Nz-0001tL-0e
	for gclcip-std-proposals@m.gmane.org; Wed, 28 Mar 2018 12:32:55 +0200
Original-Received: by mail-pf0-f199.google.com with SMTP id q22sf1203554pfh.20
        for <gclcip-std-proposals@m.gmane.org>; Wed, 28 Mar 2018 03:35:03 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1522233302; cv=pass;
        d=google.com; s=arc-20160816;
        b=BAzHQ/xm4vRHai380kEX/URGrdE4+mTSid4aYAooyTI5EMxgsPrNsCeVwSnPQpQm2d
         x+11FjhKYVwZvM8JhVyy3dUx6z3bNcc262p90KdUHXC7oQ/jnayzwyrgGyFfVDgnEBbu
         p4wrfsF1A/98GcAIxoiJ+bhjY5oCSd59iYMlK8oy5R+r2yViC5m1vMO5An32RWduCXod
         Kqk1c8Ys5s8/e7qELvnQ2mtLHQlvl8IpRUvsAxOmKd72M7lgv/j5vKhuq6WbymAMYBuR
         F+HNcMs8L8L1XJ5wc6fhibqZic2sUtT4dUlGNe586fLJwE9OTUt5Wb4FmCDNEZEN2SmL
         fLSw==
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=Ev4KLtHQEifhhgNjxCREm0+2E2DOt1UcEGt50cC1CPU=;
        b=ydCFO97c86jnVsi2ud3HmJU4oCwNjl1FinR2MOQrjY4THUE4ruXBIIhbC7wS8XK98+
         xJb1z2He32eV8MrkRalSySnp9F0o566AwJRwlSA67x8h099o0OqMXKvAdeojoPzeGS/o
         53c8+u83A5WplBuCsBj6nrMw1bgTo3lW0rgJPEmdrcoiTr7oyJnr5V5t0Phxsqhcc47o
         i4S5cS7LvVUtrFcDGKXu/PyoX2MiMHRU3NxTCnWyhhxqBQVgJ3bMUPKNp4PJYlhc7Xmx
         CiQpxjzVGC0sdsTNHx/Fa8fwCK+ZmzA1qT3xIRWqK9mLWFz9mgKuk6o97T6RX3xbBpK6
         jOcA==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=OgmSDcOP;
       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=Ev4KLtHQEifhhgNjxCREm0+2E2DOt1UcEGt50cC1CPU=;
        b=zHD6od5jAWq0Wu5654P5ZpQd3UOVaVA4TnMX1GqfW6dy84UqsA12yv6UbPeV+ZMmKz
         /JO1aWF2zJYq9R1yGx99x07IXh/Flt/RBXD2gF0jFBTcICJDmRuXKwg2IXV3SWviTGvI
         0Tw4UdZGx7GnagQdLuR37FyOIT3nV855a3JcUszTqVuzCfgfFLWoF/D2Ajl3SerekWhK
         Ns7BAXaaeNrZh6UnvIALeyDKg8zmDd/TISOdrRVkIGmh18nfcpLr3h1QMKwWUXH+BNnV
         AK0eljt5LDl0orEklt1nlQtff9VRZUn6LqcJE1ehku2PZngbJ8ECC4l2JzieHZHEpqmh
         OQOA==
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=Ev4KLtHQEifhhgNjxCREm0+2E2DOt1UcEGt50cC1CPU=;
        b=TK+hix4J6wJSZ8dZHkXHU12At59fQHcjG4dhl+QigE8dUH1hSrMiMwGjPJgOLBMHvu
         ZplUAd2SJH71lPdQq3d/fxdS/zzRVuPRzpbAZWk2OvOkCNb/b4afiWoQkYs0WdQ+06Cs
         kGFYn3cF2PTRbEsnx0ntOJ3waWlknZVtPanVEcfy1TJbjTAa6A25s80gU5tzZyVnNvCJ
         UMCS79fj7CIwdmHIg/athrSqvRtQy9uiLPJ+Qgdt59mQM0/YFMLUDAga+znZBXvHVFAF
         7Pvzn1pKd6scW/5BKpkOuy5cxf9DQoCFQ45N/tEkpLshraXFP+nKDIDpWPT6GAuQSWRb
         3wJQ==
X-Gm-Message-State: AElRT7EXCgtMeeEwufqC+8dpzgJrt2iRVMQOtjOtywnNe27PG84ARprZ
	hjdYNwmnXN6zkwNPeFHx8TX4ug==
X-Google-Smtp-Source: AG47ELsMt+GMnGOqsYGozjt/KaE+SU+/8U3RYfaKgc96qlM5R3k56xoXFmOqM2IHjJVQ3O3q7nz3Fg==
X-Received: by 2002:a17:902:8e81:: with SMTP id bg1-v6mr13760754plb.44.1522233302346;
        Wed, 28 Mar 2018 03:35:02 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a17:902:71c3:: with SMTP id t3-v6ls1660661plm.2.gmail; Wed,
 28 Mar 2018 03:35:01 -0700 (PDT)
X-Received: by 2002:a17:902:8c8e:: with SMTP id t14-v6mr3255860plo.206.1522233301003;
        Wed, 28 Mar 2018 03:35:01 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1522233300; cv=none;
        d=google.com; s=arc-20160816;
        b=QztvP0NTID2jD9aTx3GlqhQS0qBjs7LMtHNIOxBNxA14uox3stUhQaNtZDazBNH3UY
         uzlJn0ID+ncNhtDUbPEYlIjujngBxcb9oeUaGT215flK2bf/l6+z+ML/9HmkB1uNnNSK
         Qw6ylMUs65dUEG9roUTLkx9BGxKRfwnJdcfNqFgofhPBwuu2dBsgg1cy4FG67xHtRMZx
         BrUlHzjUaGFE4qL7MDU0Xu3J9M0IYXiUMtDhkAApOlbepOB5ORpXDn74QvQIqV0YFeiy
         6Cd6kfyVLsH/JZF9cmR0TdsJQHgmaWxJHscgPNnvAtogsZ80jQmrzvTxuaymNkXJw5S3
         HFsQ==
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=uN9Nj95ou/zydB1+dNZihNjmMWESDuMzEl61XzbWF2A=;
        b=AVwXi23wEY+rXfdUHBOmSStzrqIEVInO/W11ncwdLM0kWzmKsDvQDupRPlh+dlLpJ/
         L6Fu7t8AQXh/gL8GNT0FC9VoHRi8rOfhGwlt2afOchtyB8a9OEqE36OyAqLKKjh1tstE
         DXrOlXGD4XnypIG9SYhO/09y2t+Ft3VbGvMBxsAbkvQ1deXx09bzUpTnqcQq9GNJOJvD
         i2QsHiDuEiEDt5Th89hTbXT1joSoJAa34KGSCpA1V6Z1CcUDJOE2kExhIrtwbWtLeSX0
         n0Q7dMlFLLh6xgwO+TSs8i5tfQHkwB7vXgwkuSUZfy3qefByJFnLA+P9n1ltBu0QCwOP
         HCmQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=OgmSDcOP;
       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 d21-v6sor208814plr.67.2018.03.28.03.35.00
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Wed, 28 Mar 2018 03:35:00 -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:680c:: with SMTP id h12-v6mr3378777plk.46.1522233300441;
 Wed, 28 Mar 2018 03:35:00 -0700 (PDT)
Original-Received: by 10.236.175.138 with HTTP; Wed, 28 Mar 2018 03:34:59 -0700 (PDT)
In-Reply-To: <e85dfb30-f3ff-4769-90d2-373efceda1e6@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=OgmSDcOP;       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:37517
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37517>

--000000000000235d610568768f78
Content-Type: text/plain; charset="UTF-8"

On Wed, Mar 28, 2018 at 1:17 AM, Myriachan <myriachan@gmail.com> wrote:

> The C++ Standard rules state that you can treat an array of
std::complex<float> as an array of float of double the number of elements.
That is, you can do pointer arithmetic on a float * that crosses
complex<float> objects.  That cannot be done other than with compiler magic.

Only "if a is an expression of type cv complex<T>* and the expression a[i]
is well-defined for an integer expression i", which has to mean that we
have an array of complex objects. Given that each is required to be layout
compatible with T[2], reinterpreting the bigger array as T[2 * (i + 1)]
does not need any more magic.

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/CAA7YVg2n1N_QrxC09Er4vLr%2BebwQ5GhkD-3isND76d4YJHwC0g%40mail.gmail.com.

--000000000000235d610568768f78
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 1:17 AM, Myriachan <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:myriachan@gmail.com" target=3D"_blank">myriachan@gmail.com</a>&gt;</spa=
n> wrote:<br><div><br></div><div>&gt; The C++ Standard rules state that you=
 can treat an array of std::complex&lt;float&gt; as an array of float of do=
uble the number of elements.=C2=A0 That is, you can do pointer arithmetic o=
n a float * that crosses complex&lt;float&gt; objects.=C2=A0 That cannot be=
 done other than with compiler magic.</div><div><br></div><div>Only &quot;i=
f a is an expression of type cv complex&lt;T&gt;* and the expression a[i] i=
s well-defined for an integer expression i&quot;, which has to mean that we=
 have an array of complex objects. Given that each is required to be layout=
 compatible with T[2], reinterpreting the bigger array as T[2 * (i + 1)] do=
es not need any more magic.</div><div><br></div><div>Cheers,</div><div>V.</=
div><div><br></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/CAA7YVg2n1N_QrxC09Er4vLr%2BebwQ5GhkD-=
3isND76d4YJHwC0g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAA7YVg2n1N_Qrx=
C09Er4vLr%2BebwQ5GhkD-3isND76d4YJHwC0g%40mail.gmail.com</a>.<br />

--000000000000235d610568768f78--

.
