220 37358 <CAHSYqdbvMA-gv+eP1iu53J6pnLTmr9KjR4_0XJBnEsy5qth=+A@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Hyman Rosen <hyman.rosen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: `offsetof` in a macro-less, modular world
Date: Fri, 16 Mar 2018 11:13:21 -0400
Lines: 67
Approved: news@gmane.org
Message-ID: <CAHSYqdbvMA-gv+eP1iu53J6pnLTmr9KjR4_0XJBnEsy5qth=+A@mail.gmail.com>
References: <c5f5ccc4-3267-442d-8cb2-de1ae103a38e@isocpp.org>
 <2034613.rN3AoRdNao@tjmaciei-mobl1> <d4126e87-47a3-2693-e731-5a0f7f1d6732@gmail.com>
 <2319008.6H3YVR8kxN@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="001a1143dd1ebbef420567890d80"
X-Trace: blaine.gmane.org 1521213101 32025 195.159.176.226 (16 Mar 2018 15:11:41 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 16 Mar 2018 15:11:41 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDKJJPVBQMKRBJ56V7KQKGQE56BHE3I@isocpp.org Fri Mar 16 16:11:37 2018
Return-path: <std-proposals+bncBDKJJPVBQMKRBJ56V7KQKGQE56BHE3I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wr0-f199.google.com ([209.85.128.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDKJJPVBQMKRBJ56V7KQKGQE56BHE3I@isocpp.org>)
	id 1ewr17-0008Fq-8g
	for gclcip-std-proposals@m.gmane.org; Fri, 16 Mar 2018 16:11:37 +0100
Original-Received: by mail-wr0-f199.google.com with SMTP id 96sf5603806wrk.12
        for <gclcip-std-proposals@m.gmane.org>; Fri, 16 Mar 2018 08:13:44 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1521213224; cv=pass;
        d=google.com; s=arc-20160816;
        b=Oe8tp/iiDmEWieKtQE396C/+LsKetw7b8+mPL0ULZT6i5GFkMYvIYbRxg4E52tEnjh
         JM11vlx6QueBxvRI+nFKzK2xj2PJLagi7QsdCelszsWJ2Qgsfpj7tkT0n4kijBVK+TDb
         iynsQLxGcDromy1qK5tPdsKaoDanhguKEzVynaHXeL5hUOeF4usDLSaNNDTfWQjzu908
         NYPkSzRbpGuvfO5mTm4xzdVI0+eRq90dHWnEB5ogTh/L6EOlmFz3EUOpgkQ0UYtXfqSH
         4hZkF7krZF0Z04kF31y9+lAXn3l5kDch8o8l1ArFwhmzgJ3WBLiTNisIhb5T9lbRbpT4
         hj8w==
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=QB3uhm0CRih2BTdvS6Cl2mOS1bpL6Qw8CsWGcqra3LQ=;
        b=AvMjl07ox+M2W8zub69UOBcQLz9b+jAU9uZJNJSJXqyiRdTWvzSted2ieIL0app3FE
         6USm29MKUVLu88uBLn9w8zVf72HcfBqo0+3lfjj59qnbXBOQXQOCueSKwxqg6RSPG6wz
         BvRpFaXFgJnVWAqa4KjUYcIlc/CLpN9HGutH0ZRzHgn2UbmvS+M/YsceO/ETnx1fNNQL
         b01aIKJsGWUGPA+nLTUYu/1HK16f9n3XOFVRShVCUY+aIHLIJc0YInu8U8ui4Qckjs26
         PCT4yezWteb/DtPuxKX9UQ4MCe60SrooNYS1qeZuGRr5UDBIRInQIB+9xuTWFG1R4BZ5
         mZrQ==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=YA60HGlU;
       spf=pass (google.com: domain of hyman.rosen@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=hyman.rosen@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=QB3uhm0CRih2BTdvS6Cl2mOS1bpL6Qw8CsWGcqra3LQ=;
        b=zRgmjYDdSTXLKJd+TNqqDWgt8hVDLkr71mtpp2CtxDx8EMF+F8etlnKDNlpef8qq++
         ZWSzyWn01LNLum520BJPpmTkDtW9+fK5kby+US/73D2FMATa3v9G7I84Su8vWw9CxcPE
         iKeFRF8SWxJDS2HZvUsR27NYBk2EI2vATEj/dsZv/2hXdSRyXfTqLAmyx20riAorHTfB
         5S56H+quU81Zw8YZBLpHqBQGUqOG7heis4+t0chdut2dagkNOBi0QWaDqema4vLfGXOU
         fREbVcBoisXwCyV/+IasbMTJ6tIUwq5zxG//xP7GKkPnHOP//GTCTxB0lHuRpVNFQULC
         ZSPg==
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=QB3uhm0CRih2BTdvS6Cl2mOS1bpL6Qw8CsWGcqra3LQ=;
        b=SJAqQCVuEjoNmC/5bMgnjkRhVqV9P5Gi27u6MHonQAlqdwZmHQTvDaWQXpK7k4xTE6
         ZqGaZkLTVJNPugDcdDuEdZYvHzW5CXWxSxJVewO/ovTaiiTqLZkrtxJe+GFMrZVuXLkA
         exPvIdH96w2TNH0zwu3fK4AhRHE8g3ry6QkDKbsSDHq8W6zvE81BrKpeimg1NWfCP9w9
         2bFiKVL3tFfodsmwC7H6brAfYQk4CPYmtDsJmsfv985NzjqexZICCQWYZ8dWoSKTVjkh
         /w8HE7QQm14N5mE4X8/vkl6u8EZrnBKaR3MScg78IwgsENS/wMdWqK1zv+5QNETNA8eJ
         G4Nw==
X-Gm-Message-State: AElRT7HXG8WF2d8KhgfjUYjF/EmvUV/R/nP5fs0WOLp3Wj5aSt2PQW0p
	n7yYtTbhKILCemokdWeXkc+FlQ==
X-Google-Smtp-Source: AG47ELvvif0Iap/NF2nhWdn7S46TUvF4gzoEM6tmQ+c1PwTNrurQcxuNS57+5IY1U8xcLWwrG7n6pA==
X-Received: by 10.28.234.83 with SMTP id i80mr282741wmh.2.1521213224401;
        Fri, 16 Mar 2018 08:13:44 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.223.201.145 with SMTP id f17ls2079207wrh.5.gmail; Fri, 16 Mar
 2018 08:13:42 -0700 (PDT)
X-Received: by 10.223.183.193 with SMTP id t1mr1901884wre.168.1521213222788;
        Fri, 16 Mar 2018 08:13:42 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1521213222; cv=none;
        d=google.com; s=arc-20160816;
        b=WZsjGqTAqIA9uWwsZUonApCmNkLl6IAr2Vh84cCFNhFKMsad0xhUZr0XjzGHajmX/z
         WBptHVlTLqHlsOquu12KdKiYZCTlcQVolcbsj9Pk2MJx0gfEAa7KNyio5jupCiFikv47
         qJgHz+AF3PoBJiCnJljMF1jzZxrllCNhSlGwrN/paE2GSx5NTqUEMkkNsqJ4uFPa9Xg7
         kKLnfiyIHWxBl9PUJEy2o5yioJ738aVjQ40U3pBpEHF2uRYsICbCR2kOlwQQ6706S197
         i2Y7dyKvaE2jvzPCPLxHbZ+MTMmbo9Xj7YuTrP3EBQC8PXO4ym4sGaOjoxC6b6dQ9dpw
         8o5g==
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=FVqfMYCpKfHAxC9UX+tweOuyuNps1S05zd7H1+wglJg=;
        b=gOy9hJihZeTTsd44+F1mBAgULk78nWMzm2w+tmt8f4rP7zYGxPDg0mvNP2GhBg6Jk6
         GUg3lPc4wTlLm+kwCG8+aAn3ql8FO1Vic66LfZOvgBJiZTG3GTkb9YaUyxCAO1uyP2/x
         kOp9YBMXu+hQJv1hZ/W9vyGMhgu8mlyn2wlb/aHqrQlRT0M5ni7PYhE6pbrKZj5kIj8e
         RG3lq0uaYcMAWsjpK6H6574YcOvGW+uR+oavt8lU4pXys5WMB6SdScWjNAFX3h7dKC3S
         aJi2ELmPwvB525fWgt6cDf5zLhmG8le1cYOFC/BMYD6s39JCphucG2lYMRpKJQPgQYdR
         nH1Q==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=YA60HGlU;
       spf=pass (google.com: domain of hyman.rosen@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=hyman.rosen@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 r74sor317663wme.27.2018.03.16.08.13.42
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Fri, 16 Mar 2018 08:13:42 -0700 (PDT)
Received-SPF: pass (google.com: domain of hyman.rosen@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.28.146.2 with SMTP id u2mr1884679wmd.79.1521213222152; Fri,
 16 Mar 2018 08:13:42 -0700 (PDT)
Original-Received: by 10.28.55.19 with HTTP; Fri, 16 Mar 2018 08:13:21 -0700 (PDT)
In-Reply-To: <2319008.6H3YVR8kxN@tjmaciei-mobl1>
X-Original-Sender: hyman.rosen@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=YA60HGlU;       spf=pass
 (google.com: domain of hyman.rosen@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=hyman.rosen@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:37358
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37358>

--001a1143dd1ebbef420567890d80
Content-Type: text/plain; charset="UTF-8"

On Thu, Mar 15, 2018 at 8:05 PM, Thiago Macieira <thiago@macieira.org>
wrote:
>
>         int A:: *int_in_A = &A::y;      // just so we don't discuss arrays
> just now
>         A B:: *A_in_B = &B::a;
>         int B:: *int_in_B = int_in_A + A_in_B;  // syntax TBD


Rather than inventing a new syntax, the obvious solution is to allow the
creation of
member pointers using a syntax that allows C designators to be used,
instead of
just *qualified-id*s.  The code above would then just be

    struct A { int x[10]; };
    struct B { A a; };
    int B::*number_5 = &B::a.x[5];

-- 
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/CAHSYqdbvMA-gv%2BeP1iu53J6pnLTmr9KjR4_0XJBnEsy5qth%3D%2BA%40mail.gmail.com.

--001a1143dd1ebbef420567890d80
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, Mar 15, 2018 at 8:05 PM, Thiago Macieira <span dir=3D"ltr">&lt;<a href=
=3D"mailto:thiago@macieira.org" target=3D"_blank">thiago@macieira.org</a>&g=
t;</span> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int A:: *int_in_A =3D &amp;A::y;=C2=A0 =C2=A0 =
=C2=A0 // just so we don&#39;t discuss arrays just now<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 A B:: *A_in_B =3D &amp;B::a;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int B:: *int_in_B =3D int_in_A + A_in_B;=C2=A0 =
// syntax TBD</blockquote><div><br>Rather than inventing a new syntax, the =
obvious solution is to allow the creation of<br>member pointers using a syn=
tax that allows C designators to be used, instead of<br>just <i>qualified-i=
d</i>s.=C2=A0 The code above would then just be<br><br><font face=3D"monosp=
ace, monospace">=C2=A0 =C2=A0 struct A { int x[10]; };<br>=C2=A0 =C2=A0 str=
uct B { A a; };<br>=C2=A0 =C2=A0 int B::*number_5 =3D &amp;B::a.x[5];</font=
></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/CAHSYqdbvMA-gv%2BeP1iu53J6pnLTmr9KjR4=
_0XJBnEsy5qth%3D%2BA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdbvMA=
-gv%2BeP1iu53J6pnLTmr9KjR4_0XJBnEsy5qth%3D%2BA%40mail.gmail.com</a>.<br />

--001a1143dd1ebbef420567890d80--

.
