220 37359 <22ef47e6-e957-4519-820f-1decb09a116d@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: `offsetof` in a macro-less, modular world
Date: Fri, 16 Mar 2018 08:16:45 -0700 (PDT)
Lines: 81
Approved: news@gmane.org
Message-ID: <22ef47e6-e957-4519-820f-1decb09a116d@isocpp.org>
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>
 <CAHSYqdaG06U9DwCW57=UM5GrUHkXWV9Ah5u+1wDrisBSo_nQig@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_1144_1649908020.1521213405837"
X-Trace: blaine.gmane.org 1521213287 13095 195.159.176.226 (16 Mar 2018 15:14:47 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 16 Mar 2018 15:14:47 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBXV7V7KQKGQEGIE2RKI@isocpp.org Fri Mar 16 16:14:43 2018
Return-path: <std-proposals+bncBCEKFTV6ZUMBBXV7V7KQKGQEGIE2RKI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f72.google.com ([209.85.213.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBXV7V7KQKGQEGIE2RKI@isocpp.org>)
	id 1ewr44-0003Fn-NP
	for gclcip-std-proposals@m.gmane.org; Fri, 16 Mar 2018 16:14:40 +0100
Original-Received: by mail-vk0-f72.google.com with SMTP id l81sf6411311vkd.18
        for <gclcip-std-proposals@m.gmane.org>; Fri, 16 Mar 2018 08:16:48 -0700 (PDT)
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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=/1y48GsbLvgzQKbGzgeyaTiJnMx5G3qTcuDmFnq8JN0=;
        b=N5KE8ZL2cS0kiOn6q6OtG2bx0ytSxgcvZGCERcpuaK2cjMfyktCQZj3nLWeNGAjCyS
         81Vk2nnoObdrC6bvZzPvYzzp89YmXnibG8PyO6u13dzHXd5bPEOL8EY/H+hUbMN21Btt
         AUhl4bX3uakFmJU/xa7B1YmwejObgh4sWS57D6eprQMM+PlyuEV/awCrhnzjJxos54jP
         7gRAhtT0YQVUt0ITvNcSZZSGEDNUKR8x7avS7C2LE3H64Iavvk+BIeoj98lgFdWZ7UtX
         EhcSmeFZJjBSLfbVyewYjovNkZgz51d9LX+icJlJvZ8/oWEDSlEVe/a+LWxuowzR8+lC
         hj4Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=/1y48GsbLvgzQKbGzgeyaTiJnMx5G3qTcuDmFnq8JN0=;
        b=sMqmlnIsw0oYoXjjVC+rXT9bTMG9TsUs1dJZoG32F2oP3iIB6Y6pMdkIoYvE/n4YAd
         NaEUKh2isdzh6GT7lFy+U/mvVT7pLescOejQU4utmibFMzx9UAYlOjvSkTzVDT+X6RQr
         XrsW31XhI8UEMHX1jwzHDnxb5w2gts87Xv7tUf40bOidvSQhLvITPGgto1mYzy1rEiax
         /V8/TbRENRJ8EGytOnqvf2zHtiOpToQYDaTod/mq2EBIW0N5BP08+sowOIySbcUf+b3p
         6gOsuATYSZoogmDcC0e0UNAtMIs55wAvl1//CH1KpnQ2ezqXSHAM+vvw423L1Gt9Crdd
         q9VQ==
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=/1y48GsbLvgzQKbGzgeyaTiJnMx5G3qTcuDmFnq8JN0=;
        b=m7SAjpVAHil8iAQ8gJgzCXsmN7y2e8kV5gBqsYyeJag48yRcl6vX8pTC5+vAbKKHaR
         RyFFZxP/qJQpInSDUav8cOBx5CFUwBvECr10Cc9BQ7anBAsp1VXFW1cdwOAKRa/0cIiA
         YJVvPyk4pUs9roKefYlpox6j4OoNGSPyzcx1x3UhGdayg0AXsgZkItmzEbyHg27P1biO
         bOZ3Gy779Pco/Y16i+nY2ypYHjNllEJdHG4ijDlC499vFTtOcv+0b9TWHrRL1zU4as3s
         dOPYWiGj8adLlLLeQ5AK2p+M9sTNVGoA50HdOIycFUkjESNC6b301vo9UR6IxEr+EQfc
         ZTtg==
X-Gm-Message-State: AElRT7HeyKisWQOu/8voijFNp1hL+Nwu+vAOB0j2RqARjd5Ap2atv8zz
	CB1KanQaBGuRKyPoeBJxJpOSWg==
X-Google-Smtp-Source: AG47ELtHjS3RFRPhd0H4ACmxj73TqLFtWI4AibpuVqUGjXOD7fqeyStQNEILZS6u+CYq6pq2rjTSrQ==
X-Received: by 10.31.252.70 with SMTP id a67mr919067vki.11.1521213407711;
        Fri, 16 Mar 2018 08:16:47 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.50.79 with SMTP id y76ls3909960vky.7.gmail; Fri, 16 Mar
 2018 08:16:46 -0700 (PDT)
X-Received: by 10.31.151.87 with SMTP id z84mr247914vkd.5.1521213406258;
        Fri, 16 Mar 2018 08:16:46 -0700 (PDT)
In-Reply-To: <CAHSYqdaG06U9DwCW57=UM5GrUHkXWV9Ah5u+1wDrisBSo_nQig@mail.gmail.com>
X-Original-Sender: jmckesson@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:37359
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37359>

------=_Part_1144_1649908020.1521213405837
Content-Type: multipart/alternative; 
	boundary="----=_Part_1145_1684924087.1521213405838"

------=_Part_1145_1684924087.1521213405838
Content-Type: text/plain; charset="UTF-8"



On Friday, March 16, 2018 at 10:54:35 AM UTC-4, Hyman Rosen wrote:
>
> On Thu, Mar 15, 2018 at 11:55 PM, Nicol Bolas <jmck...@gmail.com 
> <javascript:>> 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.
>

And if modules can't export macros, how will `import std.cstddef` give me 
access to that module?

-- 
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/22ef47e6-e957-4519-820f-1decb09a116d%40isocpp.org.

------=_Part_1145_1684924087.1521213405838
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, March 16, 2018 at 10:54:35 AM UTC-4, Hy=
man Rosen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r"><div><div class=3D"gmail_quote">On Thu, Mar 15, 2018 at 11:55 PM, Nicol =
Bolas <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-o=
bfuscated-mailto=3D"Yu6D6PDvAgAJ" rel=3D"nofollow" onmousedown=3D"this.href=
=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;">jmck...@gmail.com</a>&gt;</span> wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr"><div>The problem I&#39;m talking about h=
ere is that if you have a `std.cstddef` module, without the ability to expo=
rt macros, it cannot export anything which is compatible with `offsetof` us=
age. So even if we make an operator for this or empower member pointers or =
whatever, the existence of such a feature won&#39;t allow you to switch fro=
m `#include &lt;cstddef&gt;` to `import std.cstddef` without changing your =
code.</div></div></blockquote><div><br>You just need to simultaneously modi=
fy C++ so that there is a built-in equivalent<br>to offsetof, and make offs=
etof a pre-defined macro that expands to that.</div></div></div></div></blo=
ckquote><div><br>And if modules can&#39;t export macros, how will `import s=
td.cstddef` give me access to that module?</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/22ef47e6-e957-4519-820f-1decb09a116d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/22ef47e6-e957-4519-820f-1decb09a116d=
%40isocpp.org</a>.<br />

------=_Part_1145_1684924087.1521213405838--

------=_Part_1144_1649908020.1521213405837--

.
