220 12749 <31db6108-4796-4619-bb1f-46ac85503427@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Myriachan <myriachan@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Usability extensions to offsetof
Date: Tue, 9 Sep 2014 13:07:59 -0700 (PDT)
Lines: 216
Approved: news@gmane.org
Message-ID: <31db6108-4796-4619-bb1f-46ac85503427@isocpp.org>
References: <fc4c748a-1805-4e92-ae3f-58bbfe6b7537@isocpp.org>
 <1790122.GP859xiMW3@tjmaciei-mobl4>
 <dedaddc6-c382-4256-83a9-6af4dbd91caf@isocpp.org>
 <3079502.NAEi170Di4@tjmaciei-mobl4>
 <c11dc8b4-df55-4530-9322-b6bd5de9ce54@isocpp.org>
 <07066304-6357-4a10-824b-7c0451608996@isocpp.org>
 <CAOfiQq=pVvepG1ciqtxhHpa_FTqJGyimbyZ+9ihWZmJCT0oRCA@mail.gmail.com>
 <CAOfiQqmK6Zq=Yb7auaNFjrwCR=HkTc6bYVcV54z26mz5FxPKTQ@mail.gmail.com>
 <13fd60e5-2882-48bc-a9df-3c8d38b416eb@isocpp.org>
 <2285060d-e475-48f8-a9cc-389487ee681f@isocpp.org>
 <8dc4102e-acda-43b0-868a-27affefbf844@isocpp.org>
 <aaff164a-40d2-433b-823a-08dde6866654@isocpp.org>
 <724de211-478f-4834-b109-f75292729d77@isocpp.org>
 <aec826ab-51d8-4195-88ba-e5c09fafb0a6@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1308_250739408.1410293279240"
X-Trace: ger.gmane.org 1410293297 2841 80.91.229.3 (9 Sep 2014 20:08:17 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 9 Sep 2014 20:08:17 +0000 (UTC)
Cc: inkwizytoryankes@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDKLT4PURQHRBIF4XWQAKGQEKAUAO6Y@isocpp.org Tue Sep 09 22:08:10 2014
Return-path: <std-proposals+bncBDKLT4PURQHRBIF4XWQAKGQEKAUAO6Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f70.google.com ([209.85.220.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDKLT4PURQHRBIF4XWQAKGQEKAUAO6Y@isocpp.org>)
	id 1XRRhr-0007bb-1R
	for gclcip-std-proposals@m.gmane.org; Tue, 09 Sep 2014 22:08:03 +0200
Original-Received: by mail-pa0-f70.google.com with SMTP id lj1sf23907385pab.9
        for <gclcip-std-proposals@m.gmane.org>; Tue, 09 Sep 2014 13:08:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc: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:content-type;
        bh=CiLsIQExPN8LZLXUT8df3V49VCcuMu8vTIzb0TVPx/g=;
        b=aN/IB0gJKfPLm2G8yIPr9KiFtzYnXWIAWcpafb0v9ZWpE3aJ8dTAM4uI1jAe9YqJwJ
         bM2JUCfvBS3GBjHTVncW3genqNsAa1WD50wrPTawtxcD5hKBk+7HDiCbyOabfDQPM3fB
         zDJIz456mSnVmbz1G7abkgvHzTBDyzCAsD+YFIAN8aN/dllb8mubWHzwpR1G1HyJsmyX
         kNVOynJhLOPVDsexNigsWIi/9N3gbWse7wdyduaEMGFI9yJ9zQ80i/+Bu54ws+yV+DC3
         4AAWS8SAiHgDL971kavSS7OKDUDqtTjDG0POxCcphj31/w2fCh8xo8iLXeH6RPMDviEg
         iUsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc: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:content-type;
        bh=CiLsIQExPN8LZLXUT8df3V49VCcuMu8vTIzb0TVPx/g=;
        b=A8lHknb+KyoICdeMWtBV5LnepL31drB+2M47PDNQNmiTuLIa4F9xM554ausokKzPBn
         9N7Z1+rxd/fEcC/iCkt8Jl2UGONT7ta0/bBJCVS31wLYw2znjQufPlQmaeEIUMy25JIE
         Xr97qFTYF72kl3wWOlGWlCX6JPdwLlhOYfE6F3KCZdZBu/eXltdOdKruFYfxHaudWjtA
         2iFulS/6Leu7JDJVd2R1eitVDygSzndIzJr+ysmUTuF6LAwIw9Er2sjB3afqKXZ7MwEO
         v4sGrBvePSUq0tCwqGkPnp4ha7db4p1LoWEoG8eVJgdQfJlcQxFURratsiX/3t47RPpF
         qtSQ==
X-Gm-Message-State: ALoCoQkgH2srI56uRSQKjoIdaPCvTglnNjuuj3AMvFHa/ouqiYOYZn2aH3vWkQyjRGTDUpp/pnuq
X-Received: by 10.66.66.196 with SMTP id h4mr22245476pat.18.1410293281754;
        Tue, 09 Sep 2014 13:08:01 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.79.198 with SMTP id l6ls2677928igx.39.gmail; Tue, 09 Sep
 2014 13:08:00 -0700 (PDT)
X-Received: by 10.50.2.6 with SMTP id 6mr406929igq.10.1410293280733;
        Tue, 09 Sep 2014 13:08:00 -0700 (PDT)
In-Reply-To: <aec826ab-51d8-4195-88ba-e5c09fafb0a6@isocpp.org>
X-Original-Sender: myriachan@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:12749
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/12749>

------=_Part_1308_250739408.1410293279240
Content-Type: text/plain; charset=UTF-8

On Tuesday, September 9, 2014 12:56:49 PM UTC-7, Matthew Fioravante wrote:
>
> Another option is to put the inline keyword either after the  class, or 
> after the name like the final keyword.
>
>>
>> class Foo inline {};
>> class inline Bar {};
>>
>> The reason being that if we were to use the inline keyword as is, then 
>> inline would not be able to be used in front of variable declarations for 
>> some hypothetical new feature later.
>>
>>
>> inline class A {}; //An inner class definition
>> inline int a; //Cool new feature, inline variable int a
>> inline class B {} b; //Is this an inline class or an inline variable?
>>
>>
>> This also resolve's Melissa's dilemma.
>>
>>
Yes, this works much better.  C and C++ have always had keywords before 
class/struct/union refer to the variable/function/typedef afterward rather 
than the class being declared.

How would the special member functions work, especially across outer 
instances?  For example, what would happen if you did:

struct Outer
{
    struct Inner inline
    {
        //...
    };

    void CopyOuter(Inner &dest, const Inner &src) const
    {
        dest = src;
    }

    Inner m_inner;
};

int main()
{
    Outer outer1, outer2;
    outer1.CopyInner(outer1.m_inner, outer2.m_inner);
    return 0;
}


Melissa

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_1308_250739408.1410293279240
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tuesday, September 9, 2014 12:56:49 PM UTC-7, Matthew F=
ioravante 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">Another option is to put the inline keyword either after the&nbsp; class=
, or after the name like the final keyword.<br><blockquote class=3D"gmail_q=
uote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;paddin=
g-left:1ex"><div dir=3D"ltr"><div><br><div style=3D"background-color:rgb(25=
0,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1p=
x;word-wrap:break-word"><code><div><span style=3D"color:#008">class</span><=
span style=3D"color:#000"> </span><span style=3D"color:#606">Foo</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#660">inline {}</span><=
span style=3D"color:#660">;</span><span style=3D"color:#000"><br></span><sp=
an style=3D"color:#008">class</span><span style=3D"color:#000"> </span><spa=
n style=3D"color:#008">inline</span><span style=3D"color:#000"> </span><spa=
n style=3D"color:#606">Bar</span><span style=3D"color:#000"> </span><span s=
tyle=3D"color:#660">{};</span><span style=3D"color:#000"><br></span></div><=
/code></div><br>The reason being that if we were to use the inline keyword =
as is, then inline would not be able to be used in front of variable declar=
ations for some hypothetical new feature later.<br><br><div style=3D"backgr=
ound-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:soli=
d;border-width:1px;word-wrap:break-word"><code><div><span style=3D"color:#0=
00"><br></span><span style=3D"color:#008">inline</span><span style=3D"color=
:#000"> </span><span style=3D"color:#008">class</span><span style=3D"color:=
#000"> A </span><span style=3D"color:#660">{};</span><span style=3D"color:#=
000"> </span><span style=3D"color:#800">//An inner class definition</span><=
span style=3D"color:#000"><br></span><span style=3D"color:#008">inline</spa=
n><span style=3D"color:#000"> </span><span style=3D"color:#008">int</span><=
span style=3D"color:#000"> a</span><span style=3D"color:#660">;</span><span=
 style=3D"color:#000"> </span><span style=3D"color:#800">//Cool new feature=
, inline variable int a</span><span style=3D"color:#000"><br></span><span s=
tyle=3D"color:#008">inline</span><span style=3D"color:#000"> </span><span s=
tyle=3D"color:#008">class</span><span style=3D"color:#000"> B </span><span =
style=3D"color:#660">{}</span><span style=3D"color:#000"> b</span><span sty=
le=3D"color:#660">;</span><span style=3D"color:#000"> </span><span style=3D=
"color:#800">//Is this an inline class or an inline variable?</span><span s=
tyle=3D"color:#000"><br><br></span></div></code></div><br>This also resolve=
's Melissa's dilemma.<br><br></div></div></blockquote></div></blockquote><d=
iv><br>Yes, this works much better.&nbsp; C and C++ have always had keyword=
s before <span style=3D"font-family: courier new,monospace;">class</span>/<=
span style=3D"font-family: courier new,monospace;">struct</span>/<span styl=
e=3D"font-family: courier new,monospace;">union</span> refer to the variabl=
e/function/<span style=3D"font-family: courier new,monospace;">typedef</spa=
n> afterward rather than the class being declared.<br><br>How would the spe=
cial member functions work, especially across outer instances?&nbsp; For ex=
ample, what would happen if you did:<br><br><div class=3D"prettyprint" styl=
e=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187)=
; border-style: solid; border-width: 1px; word-wrap: break-word;"><code cla=
ss=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008=
;" class=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"s=
tyled-by-prettify">Outer</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><=
br>&nbsp; &nbsp; </span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">struct</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Inner<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">inline</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; &nbsp; =
&nbsp; </span><span style=3D"color: #800;" class=3D"styled-by-prettify">//.=
...</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbs=
p; &nbsp; </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=
&nbsp; &nbsp; </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">void</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">CopyOuter</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #606;" class=3D"styled-by-prettify">Inner</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">dest</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">const</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Inn=
er</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify">src</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">const</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>&nbsp; &nbsp; &nbsp; &nbsp; dest </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> src</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br><br>&nbsp; &nbsp; </span><span style=3D"col=
or: #606;" class=3D"styled-by-prettify">Inner</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> m_inner</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br><br></span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> main</span><span style=3D"color: #660;" class=3D"styled-by-prettify">()</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span><s=
pan style=3D"color: #606;" class=3D"styled-by-prettify">Outer</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> outer1</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> outer2</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br>&nbsp; &nbsp; outer1</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #606=
;" class=3D"styled-by-prettify">CopyInner</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">outer1</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify">m_inner</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
outer2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify">m_inner</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">return</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">0</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br></span></div></code></div><br><br>Melissa<br></div></div=
>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1308_250739408.1410293279240--

.
