220 7678 <CAOfiQqmTj8d6gwTNO75Oh_ny0-BJZBYu8GH--Q+8WgXADYq_PA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Richard Smith <richard@metafoo.co.uk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Proposal to add C99 designated initializers to C++
Date: Sun, 10 Nov 2013 18:42:14 -0800
Lines: 192
Approved: news@gmane.org
Message-ID: <CAOfiQqmTj8d6gwTNO75Oh_ny0-BJZBYu8GH--Q+8WgXADYq_PA@mail.gmail.com>
References: <a54ba091-3aeb-4fd5-b55e-584571f4e746@isocpp.org>
	<CAN=4vMpv76dsCP1s_bAsToLADdAq6z6J=FV4qfmZO5x6WwXBVg@mail.gmail.com>
	<f785252a-b2e1-4130-b8a4-33f7c7da3b22@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e011834d8fdf1dd04eaddadac
X-Trace: ger.gmane.org 1384137734 1268 80.91.229.3 (11 Nov 2013 02:42:14 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 11 Nov 2013 02:42:14 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDVNBJG4YAIBBB4IQGKAKGQEUJOA4EY@isocpp.org Mon Nov 11 03:42:18 2013
Return-path: <std-proposals+bncBDVNBJG4YAIBBB4IQGKAKGQEUJOA4EY@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+bncBDVNBJG4YAIBBB4IQGKAKGQEUJOA4EY@isocpp.org>)
	id 1VfhSD-0005Cj-HM
	for gclcip-std-proposals@m.gmane.org; Mon, 11 Nov 2013 03:42:17 +0100
Original-Received: by mail-pa0-f70.google.com with SMTP id hz1sf3060981pad.1
        for <gclcip-std-proposals@m.gmane.org>; Sun, 10 Nov 2013 18:42:16 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:sender:in-reply-to:references:date
         :message-id:subject:from: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:content-type;
        bh=ONuJzYbRZRuR1ph0fg6HY2FpKu0ncZC/hNbo2OTcQWs=;
        b=Mz6ee6i7VgyWrugkEFGgTSbjjMFhVd0NLUq0lRjprvyp4R6j3mffslBAzza4rU8VDI
         /WZ/GDie48OhQKea5THOXpyYrSEC22fpo3l6TLU/z7HJNAPZ3BS8Q/7Llck+7wChxWkG
         Ey4/QHhVjPksCBDaceO5Y7d+luC2dTStds566eW7OvFAK5WIHtjp45neP/n5ZX9Tj1/V
         XQgGO1G9cXWfl4dLKmCUFL2x4RdGBMPPVDz40u+tffxjyVN6F9YLzZAokzfcK95YTwoe
         dNm1+cvJBF4sSIxjTzSJp76ykBabExyv3Fxc9dZPY75mFswSMudKhJtoHFBsb+96gYuz
         IZtQ==
X-Gm-Message-State: ALoCoQlXvwotLs2jATaEw+jnVDSo9GuKU+tBIOZX2ZUarTITc38p8U6hEOW2k5qgVsNdmpf/Woaf
X-Received: by 10.66.144.133 with SMTP id sm5mr8981604pab.5.1384137736444;
        Sun, 10 Nov 2013 18:42:16 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.27.199 with SMTP id v7ls2272858qeg.85.gmail; Sun, 10 Nov
 2013 18:42:15 -0800 (PST)
X-Received: by 10.58.255.233 with SMTP id at9mr2848852ved.20.1384137735772;
        Sun, 10 Nov 2013 18:42:15 -0800 (PST)
Original-Received: from mail-vc0-x22d.google.com (mail-vc0-x22d.google.com [2607:f8b0:400c:c03::22d])
        by mx.google.com with ESMTPS id dj3si8767039vcb.44.2013.11.10.18.42.14
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 10 Nov 2013 18:42:14 -0800 (PST)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2607:f8b0:400c:c03::22d as permitted sender) client-ip=2607:f8b0:400c:c03::22d;
Original-Received: by mail-vc0-f173.google.com with SMTP id lh4so2845602vcb.18
        for <std-proposals@isocpp.org>; Sun, 10 Nov 2013 18:42:14 -0800 (PST)
X-Received: by 10.58.39.97 with SMTP id o1mr21843500vek.15.1384137734613; Sun,
 10 Nov 2013 18:42:14 -0800 (PST)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.58.100.145 with HTTP; Sun, 10 Nov 2013 18:42:14 -0800 (PST)
In-Reply-To: <f785252a-b2e1-4130-b8a4-33f7c7da3b22@isocpp.org>
X-Original-Sender: richard@metafoo.co.uk
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of metafoo@gmail.com designates 2607:f8b0:400c:c03::22d as permitted
 sender) smtp.mail=metafoo@gmail.com;       dkim=pass header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:7678
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7678>

--089e011834d8fdf1dd04eaddadac
Content-Type: text/plain; charset=ISO-8859-1

The wording isn't quite right in a few ways, but CWG will deal with that if
the proposal gets past EWG. I would suggest not allowing the overriding
that C allows -- it's not necessary to get the majority of the value from
the feature, and it provides very surprising behavior. Just make it
ill-formed.

You should also define how the initializers are sequenced. In C they are
unsequenced, which doesn't match C++'s more-specified rules for braced
initializers. I would suggest making them sequenced in member order (rather
than, for instance, in order of appearance), so that designated
initialization exactly matches the behavior of constructor initializers.


On Sun, Nov 10, 2013 at 3:58 PM, Daryle Walker <darylew@gmail.com> wrote:

> OK, so could representatives from both the Visual Studio and Clang teams
> take a look? (If GCC also does it, or wants to, they can take a look too.)
>
> Daryle W.
>
>
>
> On Friday, November 8, 2013 6:27:40 AM UTC-5, Roman Perepelitsa wrote:
>
>> FYI: clang supports designated initializers for aggregates when compiling
>> in C++11 mode.
>>
>> Roman Perepelitsa.
>>
>>
>> 2013/11/8 Daryle Walker <dar...@gmail.com>
>>
>>> [Excuse any mistakes from me doing an all-nighter to get this proposal
>>> out here.]
>>>
>>> I made a proposal<http://htmlpreview.github.io/?https://raw.github.com/CTMacUser/multiarray-iso-proposal/master/designation-proposal.html>on how to have C99's designated initializers in C++. In C, you can precede
>>> an initializer inside a struct/union or array aggregate with the access
>>> method ([x] for array elements, ".Whatever" for structs and unions, and can
>>> mix & match) to get to a specific subobject to be initialized. I had to
>>> create the text nearly from scratch since C and C++ use very different ways
>>> to express the same concepts. Plus C++ has to worry about non-dumb classes.
>>>
>>> I'd especially like if the crew for Microsoft Visual Studio 2013 took a
>>> look to see if I described your practice correctly.
>>>
>>> Daryle W.
>>>
>>>  --
>>>
>>> ---
>>> 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-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>>
>>> Visit this group at http://groups.google.com/a/isocpp.org/group/std-
>>> proposals/.
>>>
>>
>>  --
>
> ---
> 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/.
>

-- 

--- 
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/.

--089e011834d8fdf1dd04eaddadac
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">The wording isn&#39;t quite right in a few ways, but CWG w=
ill deal with that if the proposal gets past EWG. I would suggest not allow=
ing the overriding that C allows -- it&#39;s not necessary to get the major=
ity of the value from the feature, and it provides very surprising behavior=
.. Just make it ill-formed.<div>
<br></div><div>You should also define how the initializers are sequenced. I=
n C they are unsequenced, which doesn&#39;t match C++&#39;s more-specified =
rules for braced initializers. I would suggest making them sequenced in mem=
ber order (rather than, for instance, in order of appearance), so that desi=
gnated initialization exactly matches the behavior of constructor initializ=
ers.</div>
</div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Sun,=
 Nov 10, 2013 at 3:58 PM, Daryle Walker <span dir=3D"ltr">&lt;<a href=3D"ma=
ilto:darylew@gmail.com" target=3D"_blank">darylew@gmail.com</a>&gt;</span> =
wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">OK, so could representative=
s from both the Visual Studio and Clang teams take a look? (If GCC also doe=
s it, or wants to, they can take a look too.)<br>
<br>Daryle W.<div class=3D"im"><br><br><br>On Friday, November 8, 2013 6:27=
:40 AM UTC-5, Roman Perepelitsa wrote:</div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex">
<div class=3D"im"><div dir=3D"ltr">FYI: clang supports designated initializ=
ers for aggregates when compiling in C++11 mode.<div><br></div><div>Roman P=
erepelitsa.</div></div></div><div><br><br><div class=3D"gmail_quote">2013/1=
1/8 Daryle Walker <span dir=3D"ltr">&lt;<a>dar...@gmail.com</a>&gt;</span><=
br>


<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im"><div dir=3D"ltr"><div>[Exc=
use any mistakes from me doing an all-nighter to get this proposal out here=
..]</div>
<div><br></div>

<div>I made a <a href=3D"http://htmlpreview.github.io/?https://raw.github.c=
om/CTMacUser/multiarray-iso-proposal/master/designation-proposal.html" targ=
et=3D"_blank">proposal</a> on how to have C99&#39;s designated initializers=
 in C++. In C, you can precede an initializer inside a struct/union or arra=
y aggregate with the access method ([x] for array elements, &quot;.Whatever=
&quot; for structs and unions, and can mix &amp; match) to get to a specifi=
c subobject to be initialized. I had to create the text nearly from scratch=
 since C and C++ use=A0very different ways to express the same concepts. Pl=
us C++ has to worry about non-dumb classes.</div>


<div><br></div><div>I&#39;d especially like if the crew for Microsoft Visua=
l Studio 2013 took a look to see if I described your practice correctly.</d=
iv><div><br></div><div>Daryle W.</div><span><font color=3D"#888888"><div>


<br></div></font></span></div></div><span><font color=3D"#888888"><div clas=
s=3D"im">

<p></p>

-- <br>
=A0<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br></div>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a>std-proposal...@<u></u>isocpp.org</a>.<br>
To post to this group, send email to <a>std-pr...@isocpp.org</a>.<div class=
=3D"im"><br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/<u></u>isocpp.=
org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></div>
</blockquote></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
=A0<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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />

--089e011834d8fdf1dd04eaddadac--

.
