220 37357 <CAHSYqdaG06U9DwCW57=UM5GrUHkXWV9Ah5u+1wDrisBSo_nQig@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 10:54:11 -0400
Lines: 70
Approved: news@gmane.org
Message-ID: <CAHSYqdaG06U9DwCW57=UM5GrUHkXWV9Ah5u+1wDrisBSo_nQig@mail.gmail.com>
References: <c5f5ccc4-3267-442d-8cb2-de1ae103a38e@isocpp.org>
 <CALmDwq38-kBPK2QnEPLkzM9z7r_jXif7oBoO+A7CMm9XBUC96g@mail.gmail.com>
 <e7a864e9-a866-40d6-9688-95219dc34d92@isocpp.org> <71ed1718-d272-4920-92fe-3b59750e6fb8@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="001a114975742fea86056788c9c2"
X-Trace: blaine.gmane.org 1521211954 17129 195.159.176.226 (16 Mar 2018 14:52:34 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 16 Mar 2018 14:52:34 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDKJJPVBQMKRBKNVV7KQKGQEEZWMZZQ@isocpp.org Fri Mar 16 15:52:30 2018
Return-path: <std-proposals+bncBDKJJPVBQMKRBKNVV7KQKGQEEZWMZZQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wr0-f197.google.com ([209.85.128.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDKJJPVBQMKRBKNVV7KQKGQEEZWMZZQ@isocpp.org>)
	id 1ewqiZ-0004L6-NW
	for gclcip-std-proposals@m.gmane.org; Fri, 16 Mar 2018 15:52:27 +0100
Original-Received: by mail-wr0-f197.google.com with SMTP id j3sf5542076wrb.18
        for <gclcip-std-proposals@m.gmane.org>; Fri, 16 Mar 2018 07:54:35 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1521212074; cv=pass;
        d=google.com; s=arc-20160816;
        b=H0pkYsvc9+QAgzrdm88M2cs6/iQjzgyBsET1mB5PUiQvEUhRWcIkGBJ+2Rs/CCq3Tp
         X/SWPS2NDrdI4NxwYx2dCnGL78rTe5KDddjP+91QHpLNvrmL9tO5wlc+IJ5AD0jFziL7
         YHK8OJ/LKQgmpDRSHmdxpDSNANclVA+sDMTLXMcnmVDxI70U4D4xQrZlKqkDvw84xEKf
         np6/90i5/pB1i5g+urA94t8y+rblivb4v9xlXQbkMWqzw/9z+gVBHqjLjswy4mvWbFwH
         4uR7YTJkSxW+W+mkKjLlzr/xBOK9YWKU8idPtcKapczWyi9HngyDXBOVzTusKkK1Kd7P
         JxIQ==
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=7/FpWwqGEOgAAyOwW/iTjNhcynaZkcKYPvaHlMQ4VhQ=;
        b=xncf6KpGE1W6wTwdJHsoHYCU2XVyBYRjNfl24tj0v6iR9IFStRJuZzjB3tl0vKOZHS
         AWqoOBFVRmz3txUAgXFGe7GSAObpB1rcNoNfFi+8sq+IiscZj6+lq1lITVht/gb420nF
         0uwvL92o6BFI96zu4JGpLW1MSurhyzBemBCAvlvwNF69Eb+7DCh4uQbpTLEOHEbtWKw2
         PoFheouXhszSnPeD/yjJ/uT4m2adyXVsVNec+AWthB1+U5pVrG+4nto0SzzgRWWg1i4u
         4LwLtlNk1fZFz6Sk/isWq7ovr2epy6hS7+5keSqrz0d+C0Qhh32VnMK2+raukYajXhGM
         R4xw==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=cDhyh3aU;
       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=7/FpWwqGEOgAAyOwW/iTjNhcynaZkcKYPvaHlMQ4VhQ=;
        b=BGtJobZZxT8ySh0FbhCBNkSf6g5tchz3GbV3xQQrpUOXgjNQNFwevWUShAFMDjE/Kr
         MZrm9w04zYpR/WB7fz1k59aEa6B5z0q30GCT7c8eEwQpHOM852CD+1JIw9c6G7hK3o14
         WJoguN3KiypWjFFwoEoLVv8/dtRm5ZI/Cq0U4XRSpjl2LQEZKBv2bUnKUhL4yyMl71hw
         4XldyiogfGpSvmc333YqoZjzeWi2fY9FynSseyrAoDOkbC6HxwDZq7jvMf0ysu9UY1jV
         oYQjqISlFIFxj++TozrFA9cMTZJAzChh/gdfQHCO5eEdbzRzBqY48zjaiIVeZ/efv/UY
         /hNQ==
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=7/FpWwqGEOgAAyOwW/iTjNhcynaZkcKYPvaHlMQ4VhQ=;
        b=RWaR0ajKP59IU4JJCN/ZT26JhewWGJ98xlsvvLjvxv62/ys9NloOMS9p16CdxjR6rN
         txO29rEMZXyKkpH1UVpooa7r9M00oy64Qc1YPH+svZ6QT9bGoRn4ZjHUcelZrl4HGGfZ
         GwT4rd0uXxG/ZNNg0oFKuI/IkOUDfvgv0zRFMgfU+E1miedUCHof5T3AxNXVyG0048yP
         SYm1syKBzEOu97E3JLBDYJKo2il/Agn86USB1duh4Wj6Y8YNIw6zfI3YizrjKrjZEun2
         Iw4FSCMRXlTA8Wj6zwjPmx9ouWpuqa2oXJaGwVFPuSPZ3h5vcNmoQa61okZwoe2Px57b
         QtEQ==
X-Gm-Message-State: AElRT7EMk6VE5zhpOTtWR7kPG6SWqOSMhiR7YJXGSWxdV5Z47m3k+UK1
	ViYqayXfxpWXg0ZRkv1R2QYiSg==
X-Google-Smtp-Source: AG47ELs7ZpNqqYPJCECu+pskj4SoKpRcb0jcgxJgzCvG8A8L5JsObCnu8IOeBtlflgALdILGj1DwvQ==
X-Received: by 10.28.116.17 with SMTP id p17mr255217wmc.29.1521212074757;
        Fri, 16 Mar 2018 07:54:34 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.197.200 with SMTP id v191ls420236wmf.1.canary-gmail; Fri,
 16 Mar 2018 07:54:33 -0700 (PDT)
X-Received: by 10.28.130.9 with SMTP id e9mr1919536wmd.161.1521212073050;
        Fri, 16 Mar 2018 07:54:33 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1521212073; cv=none;
        d=google.com; s=arc-20160816;
        b=IhyXbfTKjoIzaAGFthEhyjjH6K7Rhw0cwhneLY6HsdOhsmUTbGOdNA9GGboBG5aTyD
         1J7Rmsisv5+3uyBLDmMOlwUjjAN1p4d4YCqHISFnLMg+fJEdndC9a7QSqxZiETlc4dlf
         VhJj+wyg/xvbmjFgqABctbFQWAdsHUi/2eXHYgR8t2vNzTZO8rXNZ7Cu361mDdYAPtLe
         jbB9Y6XEGF75pOHwBSn/G3Y3G9eq4HIrRS2/pfOBKMv9lGaVjqks6fb/WlMv4uOxrs0x
         UonHMkjCk80l0/OyJO070BN7ZGQKL8KGefUfNYQpQm9wZATEjjysjzNbm4W2RDowE/8H
         xZ0w==
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=YDO4AlUiAH2XwVk9n7Yt2U/SjvEHHwl7Ty02sxEz9rI=;
        b=NLife7UUmULVbEfFErc6sD78PKVmnHmLgfgqL/0u25ZSDdjKg4e177GKMPQjYV9Pcc
         kxwGFdJsn9PC9E0W8tzHPh2FqhfkD9qkoeXvIyF3PkFQdGIWWQWj34LRshtTx78sfRgp
         qkzeVEovLLiK56oLaXKOCIX8SXoQQI+uS9zGkbVsb5RErlmBHPE2DX/Wb98Uvlyp5Q/g
         5bfZ9gfvjEORwd+b210oVAIF8PLdvp9MxC/Cobu8JEI+MrN9bfWE2jsHdanXrHltfEgs
         uKvNqxVNw1EIW9LeK3qdD7pshRGJqPGsB4L4IAS3R/owSOprM269FSsJJajlsc4/4u8G
         i2EA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=cDhyh3aU;
       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 b9sor3566097wrh.54.2018.03.16.07.54.33
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Fri, 16 Mar 2018 07:54:33 -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.223.134.210 with SMTP id 18mr2100477wry.232.1521212072125;
 Fri, 16 Mar 2018 07:54:32 -0700 (PDT)
Original-Received: by 10.28.55.19 with HTTP; Fri, 16 Mar 2018 07:54:11 -0700 (PDT)
In-Reply-To: <71ed1718-d272-4920-92fe-3b59750e6fb8@isocpp.org>
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=cDhyh3aU;       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:37357
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37357>

--001a114975742fea86056788c9c2
Content-Type: text/plain; charset="UTF-8"

On Thu, Mar 15, 2018 at 11:55 PM, Nicol Bolas <jmckesson@gmail.com> wrote:
>
> The problem I'm talking about here is that if you have a `std.cstddef`
> module, without the ability to export macros, it cannot export anything
> which is compatible with `offsetof` usage. So even if we make an operator
> for this or empower member pointers or whatever, the existence of such a
> feature won't allow you to switch from `#include <cstddef>` to `import
> std.cstddef` without changing your code.
>

You just need to simultaneously modify C++ so that there is a built-in
equivalent
to offsetof, and make offsetof a pre-defined macro that expands to that.
Why is
that difficult?

Are you imagining that modular C++ isn't going to have a preprocessor at
all?
Users of __FILE__, __LINE__, __PRETTY_FUNCTION__, and __COUNTER__
may want to have a word with you.

-- 
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/CAHSYqdaG06U9DwCW57%3DUM5GrUHkXWV9Ah5u%2B1wDrisBSo_nQig%40mail.gmail.com.

--001a114975742fea86056788c9c2
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 11:55 PM, Nicol Bolas <span dir=3D"ltr">&lt;<a href=3D"=
mailto:jmckesson@gmail.com" target=3D"_blank">jmckesson@gmail.com</a>&gt;</=
span> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>The proble=
m I&#39;m talking about here is that if you have a `std.cstddef` module, wi=
thout the ability to export macros, it cannot export anything which is comp=
atible with `offsetof` usage. So even if we make an operator for this or em=
power member pointers or whatever, the existence of such a feature won&#39;=
t allow you to switch from `#include &lt;cstddef&gt;` to `import std.cstdde=
f` without changing your code.</div></div></blockquote><div><br>You just ne=
ed to simultaneously modify C++ so that there is a built-in equivalent<br>t=
o offsetof, and make offsetof a pre-defined macro that expands to that.=C2=
=A0 Why is<br>that difficult?<br><br>Are you imagining that modular C++ isn=
&#39;t going to have a preprocessor at all?<br>Users of __FILE__, __LINE__,=
 __PRETTY_FUNCTION__, and __COUNTER__<br>may want to have a word with you.<=
/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/CAHSYqdaG06U9DwCW57%3DUM5GrUHkXWV9Ah5=
u%2B1wDrisBSo_nQig%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdaG06U9=
DwCW57%3DUM5GrUHkXWV9Ah5u%2B1wDrisBSo_nQig%40mail.gmail.com</a>.<br />

--001a114975742fea86056788c9c2--

.
