Topic: Designated initializers (like C99)
Author: Daryle Walker <darylew@gmail.com>
Date: Fri, 25 Oct 2013 14:56:35 -0700 (PDT)
Raw View
------=_Part_1174_6175270.1382738195432
Content-Type: text/plain; charset=ISO-8859-1
Should we add designated initializer syntax, like C-1999 has? Is there any
fundamental breakage/hatred to the idea even if it's officially proposed,
like C-1999's variable-length arrays?
Glancing at the feature from a copy of the C-1999 Standard, I'm wondering
about a case of how it works with unions. You can specify a non-first
member to initialize a union. There is also a rule that if a sub-object is
covered more than once then the lexically-last one takes precedence. What
about:
MyType whatever = { .variantA = 6, .variantB = 'c' };
where the two members are union siblings. Here, I think the second one
takes precedence, so the owning union is initialized via its "variantB"
member, and it's set to 'c'.
MyType whatever = { .something.variantA.x = t, .something.variantB.y = 1L };
I expect the same thing to happen. The "something" union member is set to
use "variantB" as its current member and anything from "variantA" is
ignored. The "y" sub-member is initialized to 1, and any other sub-members
are value-initialized (assuming "variantB" is non-union).
An alternate opinion: when a union's active member is changed via a
sub-member's initialization, the result should be ill-formed?
MyType whatever = { .s.AA.x = 1, .s.BB[4] = L'x', .s.AA.y = hello };
As before, "AA" and "BB" are union member siblings. At the end of the
initialization, the "AA" member of the "s" union is initialized. The "y"
sub-member is set to an enumeration, but does the "x" sub-member join the
other sub-members in being value-initialized, or is the first
initialization clause reinstated (although it was voided by the second)?
Hopefully, someone in C's version of the working group committees has
already asked this, since it doesn't seem to be covered in C99. (Maybe C11
already has a resolution.)
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-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_1174_6175270.1382738195432
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Should we add designated initializer syntax, like C-1999 h=
as? Is there any fundamental breakage/hatred to the idea even if it's offic=
ially proposed, like C-1999's variable-length arrays?<div><br></div><div>Gl=
ancing at the feature from a copy of the C-1999 Standard, I'm wondering abo=
ut a case of how it works with unions. You can specify a non-first member t=
o initialize a union. There is also a rule that if a sub-object is covered =
more than once then the lexically-last one takes precedence. What about:</d=
iv><div><br></div><div class=3D"prettyprint" style=3D"background-color: rgb=
(250, 250, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-wor=
d;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #606;" class=3D"styled-by-prettify">MyType</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> whatever </span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
variantA </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #066;" class=3D"styled-by-prettify">6</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">variantB </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #080;" class=3D"styled-by-pr=
ettify">'c'</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div=
></code></div><div><br></div><div>where the two members are union siblings.=
Here, I think the second one takes precedence, so the owning union is init=
ialized via its "<font face=3D"courier new, monospace">variantB</font>" mem=
ber, and it's set to<font face=3D"courier new, monospace"> 'c'</font>.</div=
><div><br></div><div class=3D"prettyprint" style=3D"background-color: rgb(2=
50, 250, 250); border: 1px solid rgb(187, 187, 187); word-wrap: break-word;=
"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"=
color: #606;" class=3D"styled-by-prettify">MyType</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> whatever </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">som=
ething</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify">variantA</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify">x </span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> t</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>something</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
..</span><span style=3D"color: #000;" class=3D"styled-by-prettify">variantB<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">y </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;=
" class=3D"styled-by-prettify">1L</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span></div></code></div><div><br>I expect the same thing to ha=
ppen. The "<font face=3D"courier new, monospace">something</font>" union me=
mber is set to use "<font face=3D"courier new, monospace">variantB</font>" =
as its current member and anything from "<font face=3D"courier new, monospa=
ce">variantA</font>" is ignored. The "<font face=3D"courier new, monospace"=
>y</font>" sub-member is initialized to 1, and any other sub-members are va=
lue-initialized (assuming "<font face=3D"courier new, monospace">variantB</=
font>" is non-union).<br></div><div><br></div><div>An alternate opinion: wh=
en a union's active member is changed via a sub-member's initialization, th=
e result should be ill-formed?</div><div><br></div><div class=3D"prettyprin=
t" style=3D"background-color: rgb(250, 250, 250); border: 1px solid rgb(187=
, 187, 187); word-wrap: break-word;"><code class=3D"prettyprint"><div class=
=3D"subprettyprint"><span style=3D"color: #606;" class=3D"styled-by-prettif=
y">MyType</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
whatever </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">s</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">AA</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">x =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">s</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">BB<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">[</span><sp=
an style=3D"color: #066;" class=3D"styled-by-prettify">4</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: #660;" =
class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> L</span><span style=3D"color: #080;" class=3D"styl=
ed-by-prettify">'x'</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">s</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">AA</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">y </span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> hello </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r></span></div></code></div><div><br>As before, "<font face=3D"courier new,=
monospace">AA</font>" and "<font face=3D"courier new, monospace">BB</font>=
" are union member siblings. At the end of the initialization, the "<font f=
ace=3D"courier new, monospace">AA</font>" member of the "<font face=3D"cour=
ier new, monospace">s</font>" union is initialized. The "<font face=3D"cour=
ier new, monospace">y</font>" sub-member is set to an enumeration, but does=
the "<font face=3D"courier new, monospace">x</font>" sub-member join the o=
ther sub-members in being value-initialized, or is the first initialization=
clause reinstated (although it was voided by the second)?<br></div><div><b=
r></div><div>Hopefully, someone in C's version of the working group committ=
ees has already asked this, since it doesn't seem to be covered in C99. (Ma=
ybe C11 already has a resolution.)</div><div><br></div><div>Daryle W.</div>=
<div><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" 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 />
------=_Part_1174_6175270.1382738195432--
.
Author: Richard Smith <richard@metafoo.co.uk>
Date: Fri, 25 Oct 2013 15:06:18 -0700
Raw View
--047d7bacba9ab182d804e997f5c0
Content-Type: text/plain; charset=ISO-8859-1
On Fri, Oct 25, 2013 at 2:56 PM, Daryle Walker <darylew@gmail.com> wrote:
> Should we add designated initializer syntax, like C-1999 has? Is there any
> fundamental breakage/hatred to the idea even if it's officially proposed,
> like C-1999's variable-length arrays?
>
This has been suggested on the C++ ext reflector a couple of times, and has
found opposition and very little support.
> Glancing at the feature from a copy of the C-1999 Standard, I'm wondering
> about a case of how it works with unions. You can specify a non-first
> member to initialize a union. There is also a rule that if a sub-object is
> covered more than once then the lexically-last one takes precedence. What
> about:
>
> MyType whatever = { .variantA = 6, .variantB = 'c' };
>
> where the two members are union siblings. Here, I think the second one
> takes precedence, so the owning union is initialized via its "variantB"
> member, and it's set to 'c'.
>
> MyType whatever = { .something.variantA.x = t, .something.variantB.y = 1L
> };
>
> I expect the same thing to happen. The "something" union member is set to
> use "variantB" as its current member and anything from "variantA" is
> ignored. The "y" sub-member is initialized to 1, and any other
> sub-members are value-initialized (assuming "variantB" is non-union).
>
> An alternate opinion: when a union's active member is changed via a
> sub-member's initialization, the result should be ill-formed?
>
> MyType whatever = { .s.AA.x = 1, .s.BB[4] = L'x', .s.AA.y = hello };
>
> As before, "AA" and "BB" are union member siblings. At the end of the
> initialization, the "AA" member of the "s" union is initialized. The "y"
> sub-member is set to an enumeration, but does the "x" sub-member join the
> other sub-members in being value-initialized, or is the first
> initialization clause reinstated (although it was voided by the second)?
>
> Hopefully, someone in C's version of the working group committees has
> already asked this, since it doesn't seem to be covered in C99. (Maybe C11
> already has a resolution.)
>
IIRC C has a DR on this.
--
---
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/.
--047d7bacba9ab182d804e997f5c0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On F=
ri, Oct 25, 2013 at 2:56 PM, Daryle Walker <span dir=3D"ltr"><<a href=3D=
"mailto:darylew@gmail.com" target=3D"_blank">darylew@gmail.com</a>></spa=
n> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr">Should we add designated initializer synt=
ax, like C-1999 has? Is there any fundamental breakage/hatred to the idea e=
ven if it's officially proposed, like C-1999's variable-length arra=
ys?</div>
</blockquote><div><br></div><div>This has been suggested on the C++ ext ref=
lector a couple of times, and has found opposition and very little support.=
</div><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);borde=
r-left-style:solid;padding-left:1ex">
<div dir=3D"ltr"><div>Glancing at the feature from a copy of the C-1999 Sta=
ndard, I'm wondering about a case of how it works with unions. You can =
specify a non-first member to initialize a union. There is also a rule that=
if a sub-object is covered more than once then the lexically-last one take=
s precedence. What about:</div>
<div><br></div><div style=3D"background-color:rgb(250,250,250);border:1px s=
olid rgb(187,187,187);word-wrap:break-word"><code><div><span style=3D"color=
:rgb(102,0,102)">MyType</span><span style> whatever </span><span style=3D"c=
olor:rgb(102,102,0)">=3D</span><span style> </span><span style=3D"color:rgb=
(102,102,0)">{</span><span style> </span><span style=3D"color:rgb(102,102,0=
)">.</span><span style>variantA </span><span style=3D"color:rgb(102,102,0)"=
>=3D</span><span style> </span><span style=3D"color:rgb(0,102,102)">6</span=
><span style=3D"color:rgb(102,102,0)">,</span><span style> </span><span sty=
le=3D"color:rgb(102,102,0)">.</span><span style>variantB </span><span style=
=3D"color:rgb(102,102,0)">=3D</span><span style> </span><span style=3D"colo=
r:rgb(0,136,0)">'c'</span><span style> </span><span style=3D"color:=
rgb(102,102,0)">};</span><span style><br>
</span></div></code></div><div><br></div><div>where the two members are uni=
on siblings. Here, I think the second one takes precedence, so the owning u=
nion is initialized via its "<font face=3D"courier new, monospace">var=
iantB</font>" member, and it's set to<font face=3D"courier new, mo=
nospace"> 'c'</font>.</div>
<div><br></div><div style=3D"background-color:rgb(250,250,250);border:1px s=
olid rgb(187,187,187);word-wrap:break-word"><code><div><span style=3D"color=
:rgb(102,0,102)">MyType</span><span style> whatever </span><span style=3D"c=
olor:rgb(102,102,0)">=3D</span><span style> </span><span style=3D"color:rgb=
(102,102,0)">{</span><span style> </span><span style=3D"color:rgb(102,102,0=
)">.</span><span style>something</span><span style=3D"color:rgb(102,102,0)"=
>.</span><span style>variantA</span><span style=3D"color:rgb(102,102,0)">.<=
/span><span style>x </span><span style=3D"color:rgb(102,102,0)">=3D</span><=
span style> t</span><span style=3D"color:rgb(102,102,0)">,</span><span styl=
e> </span><span style=3D"color:rgb(102,102,0)">.</span><span style>somethin=
g</span><span style=3D"color:rgb(102,102,0)">.</span><span style>variantB</=
span><span style=3D"color:rgb(102,102,0)">.</span><span style>y </span><spa=
n style=3D"color:rgb(102,102,0)">=3D</span><span style> </span><span style=
=3D"color:rgb(0,102,102)">1L</span><span style> </span><span style=3D"color=
:rgb(102,102,0)">};</span><span style><br>
</span></div></code></div><div><br>I expect the same thing to happen. The &=
quot;<font face=3D"courier new, monospace">something</font>" union mem=
ber is set to use "<font face=3D"courier new, monospace">variantB</fon=
t>" as its current member and anything from "<font face=3D"courie=
r new, monospace">variantA</font>" is ignored. The "<font face=3D=
"courier new, monospace">y</font>" sub-member is initialized to 1, and=
any other sub-members are value-initialized (assuming "<font face=3D"=
courier new, monospace">variantB</font>" is non-union).<br>
</div><div><br></div><div>An alternate opinion: when a union's active m=
ember is changed via a sub-member's initialization, the result should b=
e ill-formed?</div><div><br></div><div style=3D"background-color:rgb(250,25=
0,250);border:1px solid rgb(187,187,187);word-wrap:break-word">
<code><div><span style=3D"color:rgb(102,0,102)">MyType</span><span style> w=
hatever </span><span style=3D"color:rgb(102,102,0)">=3D</span><span style> =
</span><span style=3D"color:rgb(102,102,0)">{</span><span style> </span><sp=
an style=3D"color:rgb(102,102,0)">.</span><span style>s</span><span style=
=3D"color:rgb(102,102,0)">.</span><span style>AA</span><span style=3D"color=
:rgb(102,102,0)">.</span><span style>x </span><span style=3D"color:rgb(102,=
102,0)">=3D</span><span style> </span><span style=3D"color:rgb(0,102,102)">=
1</span><span style=3D"color:rgb(102,102,0)">,</span><span style> </span><s=
pan style=3D"color:rgb(102,102,0)">.</span><span style>s</span><span style=
=3D"color:rgb(102,102,0)">.</span><span style>BB</span><span style=3D"color=
:rgb(102,102,0)">[</span><span style=3D"color:rgb(0,102,102)">4</span><span=
style=3D"color:rgb(102,102,0)">]</span><span style> </span><span style=3D"=
color:rgb(102,102,0)">=3D</span><span style> L</span><span style=3D"color:r=
gb(0,136,0)">'x'</span><span style=3D"color:rgb(102,102,0)">,</span=
><span style> </span><span style=3D"color:rgb(102,102,0)">.</span><span sty=
le>s</span><span style=3D"color:rgb(102,102,0)">.</span><span style>AA</spa=
n><span style=3D"color:rgb(102,102,0)">.</span><span style>y </span><span s=
tyle=3D"color:rgb(102,102,0)">=3D</span><span style> hello </span><span sty=
le=3D"color:rgb(102,102,0)">};</span><span style><br>
</span></div></code></div><div><br>As before, "<font face=3D"courier n=
ew, monospace">AA</font>" and "<font face=3D"courier new, monospa=
ce">BB</font>" are union member siblings. At the end of the initializa=
tion, the "<font face=3D"courier new, monospace">AA</font>" membe=
r of the "<font face=3D"courier new, monospace">s</font>" union i=
s initialized. The "<font face=3D"courier new, monospace">y</font>&quo=
t; sub-member is set to an enumeration, but does the "<font face=3D"co=
urier new, monospace">x</font>" sub-member join the other sub-members =
in being value-initialized, or is the first initialization clause reinstate=
d (although it was voided by the second)?<br>
</div><div><br></div><div>Hopefully, someone in C's version of the work=
ing group committees has already asked this, since it doesn't seem to b=
e covered in C99. (Maybe C11 already has a resolution.)</div></div></blockq=
uote>
<div><br></div><div>IIRC C has a DR on this.</div></div></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" 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 />
--047d7bacba9ab182d804e997f5c0--
.
Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Sat, 26 Oct 2013 23:11:34 -0700 (PDT)
Raw View
------=_Part_1559_32250965.1382854294333
Content-Type: text/plain; charset=ISO-8859-1
On Friday, October 25, 2013 3:06:18 PM UTC-7, Richard Smith wrote:
> On Fri, Oct 25, 2013 at 2:56 PM, Daryle Walker <dar...@gmail.com<javascript:>
> > wrote:
>
>> Should we add designated initializer syntax, like C-1999 has? Is there
>> any fundamental breakage/hatred to the idea even if it's officially
>> proposed, like C-1999's variable-length arrays?
>>
>
> This has been suggested on the C++ ext reflector a couple of times, and
> has found opposition and very little support.
>
This feature (or a more limited subset of it at least) was brought up "the
answer" to named parameters in that thread recently. If you recall, is the
opposition to the idea of named initializers entirely or to the C99
syntax/semantics in particular?
>
--
---
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_1559_32250965.1382854294333
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Friday, October 25, 2013 3:06:18 PM UTC-7, Richard Smit=
h wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><=
div><div class=3D"gmail_quote">On Fri, Oct 25, 2013 at 2:56 PM, Daryle Walk=
er <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-obfu=
scated-mailto=3D"-56zCZ1DF_0J">dar...@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr">Should we add designated initializer synt=
ax, like C-1999 has? Is there any fundamental breakage/hatred to the idea e=
ven if it's officially proposed, like C-1999's variable-length arrays?</div=
>
</blockquote><div><br></div><div>This has been suggested on the C++ ext ref=
lector a couple of times, and has found opposition and very little support.=
</div></div></div></div></blockquote><div><br></div><div>This feature (or a=
more limited subset of it at least) was brought up "the answer" to named p=
arameters in that thread recently. If you recall, is the opposition t=
o the idea of named initializers entirely or to the C99 syntax/semantics in=
particular?</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
------=_Part_1559_32250965.1382854294333--
.
Author: Daryle Walker <darylew@gmail.com>
Date: Sun, 27 Oct 2013 17:54:34 -0700 (PDT)
Raw View
------=_Part_396_31328510.1382921674260
Content-Type: text/plain; charset=ISO-8859-1
On Friday, October 25, 2013 6:06:18 PM UTC-4, Richard Smith wrote:
> On Fri, Oct 25, 2013 at 2:56 PM, Daryle Walker <dar...@gmail.com<javascript:>
> > wrote:
>
>> MyType whatever = { .s.AA.x = 1, .s.BB[4] = L'x', .s.AA.y = hello };
>>
>> As before, "AA" and "BB" are union member siblings. At the end of the
>> initialization, the "AA" member of the "s" union is initialized. The "y"
>> sub-member is set to an enumeration, but does the "x" sub-member join
>> the other sub-members in being value-initialized, or is the first
>> initialization clause reinstated (although it was voided by the second)?
>>
>> Hopefully, someone in C's version of the working group committees has
>> already asked this, since it doesn't seem to be covered in C99. (Maybe C11
>> already has a resolution.)
>>
>
> IIRC C has a DR on this.
>
I took a quick glance at ISO's WG 14 page (the C group, like ours is WG
21), and I didn't see it. (None of the titles suggested anything about the
designation feature.) Their group is really small, like the issues and
proposals counts are orders of magnitude smaller! Was I looking at the
wrong page?
Or maybe no DR mentioned it because it was resolved in C11. Does anyone
here have a copy?
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-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_396_31328510.1382921674260
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Friday, October 25, 2013 6:06:18 PM UTC-4, Richard Smit=
h wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><=
div><div class=3D"gmail_quote">On Fri, Oct 25, 2013 at 2:56 PM, Daryle Walk=
er <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-obfu=
scated-mailto=3D"-56zCZ1DF_0J">dar...@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><div style=3D"background-color:rgb(250,25=
0,250);border:1px solid rgb(187,187,187);word-wrap:break-word"><code><div><=
span style=3D"color:rgb(102,0,102)">MyType</span><span> whatever </span><sp=
an style=3D"color:rgb(102,102,0)">=3D</span><span> </span><span style=3D"co=
lor:rgb(102,102,0)">{</span><span> </span><span style=3D"color:rgb(102,102,=
0)">.</span><span>s</span><span style=3D"color:rgb(102,102,0)">.</span><spa=
n>AA</span><span style=3D"color:rgb(102,102,0)">.</span><span>x </span><spa=
n style=3D"color:rgb(102,102,0)">=3D</span><span> </span><span style=3D"col=
or:rgb(0,102,102)">1</span><span style=3D"color:rgb(102,102,0)">,</span><sp=
an> </span><span style=3D"color:rgb(102,102,0)">.</span><span>s</span><span=
style=3D"color:rgb(102,102,0)">.</span><span>BB</span><span style=3D"color=
:rgb(102,102,0)">[</span><span style=3D"color:rgb(0,102,102)">4</span><span=
style=3D"color:rgb(102,102,0)">]</span><span> </span><span style=3D"color:=
rgb(102,102,0)">=3D</span><span> L</span><span style=3D"color:rgb(0,136,0)"=
>'x'</span><span style=3D"color:rgb(102,102,0)">,</span><span> </span><span=
style=3D"color:rgb(102,102,0)">.</span><span>s</span><span style=3D"color:=
rgb(102,102,0)">.</span><span>AA</span><span style=3D"color:rgb(102,102,0)"=
>.</span><span>y </span><span style=3D"color:rgb(102,102,0)">=3D</span><spa=
n> hello </span><span style=3D"color:rgb(102,102,0)">};</span><span><br>
</span></div></code></div><div><br>As before, "<font face=3D"courier new, m=
onospace">AA</font>" and "<font face=3D"courier new, monospace">BB</font>" =
are union member siblings. At the end of the initialization, the "<font fac=
e=3D"courier new, monospace">AA</font>" member of the "<font face=3D"courie=
r new, monospace">s</font>" union is initialized. The "<font face=3D"courie=
r new, monospace">y</font>" sub-member is set to an enumeration, but does t=
he "<font face=3D"courier new, monospace">x</font>" sub-member join the oth=
er sub-members in being value-initialized, or is the first initialization c=
lause reinstated (although it was voided by the second)?<br>
</div><div><br></div><div>Hopefully, someone in C's version of the working =
group committees has already asked this, since it doesn't seem to be covere=
d in C99. (Maybe C11 already has a resolution.)</div></div></blockquote>
<div><br></div><div>IIRC C has a DR on this.</div></div></div></div></block=
quote><div><br></div><div>I took a quick glance at ISO's WG 14 page (the C =
group, like ours is WG 21), and I didn't see it. (None of the titles sugges=
ted anything about the designation feature.) Their group is really small, l=
ike the issues and proposals counts are orders of magnitude smaller! Was I =
looking at the wrong page?</div><div><br></div><div>Or maybe no DR mentione=
d it because it was resolved in C11. Does anyone here have a copy?</div><di=
v><br></div><div>Daryle W.</div><div><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" 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 />
------=_Part_396_31328510.1382921674260--
.
Author: Richard Smith <richard@metafoo.co.uk>
Date: Mon, 28 Oct 2013 11:15:54 -0700
Raw View
--047d7b5db26a42a6d704e9d1179a
Content-Type: text/plain; charset=ISO-8859-1
On Sun, Oct 27, 2013 at 5:54 PM, Daryle Walker <darylew@gmail.com> wrote:
> On Friday, October 25, 2013 6:06:18 PM UTC-4, Richard Smith wrote:
>
> On Fri, Oct 25, 2013 at 2:56 PM, Daryle Walker <dar...@gmail.com> wrote:
>>
>>> MyType whatever = { .s.AA.x = 1, .s.BB[4] = L'x', .s.AA.y = hello };
>>>
>>> As before, "AA" and "BB" are union member siblings. At the end of the
>>> initialization, the "AA" member of the "s" union is initialized. The "y"
>>> sub-member is set to an enumeration, but does the "x" sub-member join
>>> the other sub-members in being value-initialized, or is the first
>>> initialization clause reinstated (although it was voided by the second)?
>>>
>>> Hopefully, someone in C's version of the working group committees has
>>> already asked this, since it doesn't seem to be covered in C99. (Maybe C11
>>> already has a resolution.)
>>>
>>
>> IIRC C has a DR on this.
>>
>
> I took a quick glance at ISO's WG 14 page (the C group, like ours is WG
> 21), and I didn't see it. (None of the titles suggested anything about the
> designation feature.) Their group is really small, like the issues and
> proposals counts are orders of magnitude smaller! Was I looking at the
> wrong page?
>
The closest I can find is:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm
But that doesn't cover this case. The discussion I was thinking of was this:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html
> Or maybe no DR mentioned it because it was resolved in C11. Does anyone
> here have a copy?
>
Yes, and C11 seems to have the same wording hole.
--
---
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/.
--047d7b5db26a42a6d704e9d1179a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Sun, Oct 27, 2013 at 5:54 PM, Daryle Walker <span dir=
=3D"ltr"><<a href=3D"mailto:darylew@gmail.com" target=3D"_blank">darylew=
@gmail.com</a>></span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr">On Friday, October 25, 2013 6:06:18 PM UT=
C-4, Richard Smith wrote:<div class=3D"im">
<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:sol=
id;padding-left:1ex"><div dir=3D"ltr"><div><div class=3D"gmail_quote">On Fr=
i, Oct 25, 2013 at 2:56 PM, Daryle Walker <span dir=3D"ltr"><<a>dar...@g=
mail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><div style=3D"background-color:rgb(250,25=
0,250);border:1px solid rgb(187,187,187);word-wrap:break-word">
<code><div><span style=3D"color:rgb(102,0,102)">MyType</span><span> whateve=
r </span><span style=3D"color:rgb(102,102,0)">=3D</span><span> </span><span=
style=3D"color:rgb(102,102,0)">{</span><span> </span><span style=3D"color:=
rgb(102,102,0)">.</span><span>s</span><span style=3D"color:rgb(102,102,0)">=
..</span><span>AA</span><span style=3D"color:rgb(102,102,0)">.</span><span>x=
</span><span style=3D"color:rgb(102,102,0)">=3D</span><span> </span><span =
style=3D"color:rgb(0,102,102)">1</span><span style=3D"color:rgb(102,102,0)"=
>,</span><span> </span><span style=3D"color:rgb(102,102,0)">.</span><span>s=
</span><span style=3D"color:rgb(102,102,0)">.</span><span>BB</span><span st=
yle=3D"color:rgb(102,102,0)">[</span><span style=3D"color:rgb(0,102,102)">4=
</span><span style=3D"color:rgb(102,102,0)">]</span><span> </span><span sty=
le=3D"color:rgb(102,102,0)">=3D</span><span> L</span><span style=3D"color:r=
gb(0,136,0)">'x'</span><span style=3D"color:rgb(102,102,0)">,</span=
><span> </span><span style=3D"color:rgb(102,102,0)">.</span><span>s</span><=
span style=3D"color:rgb(102,102,0)">.</span><span>AA</span><span style=3D"c=
olor:rgb(102,102,0)">.</span><span>y </span><span style=3D"color:rgb(102,10=
2,0)">=3D</span><span> hello </span><span style=3D"color:rgb(102,102,0)">};=
</span><span><br>
</span></div></code></div><div><br>As before, "<font face=3D"courier n=
ew, monospace">AA</font>" and "<font face=3D"courier new, monospa=
ce">BB</font>" are union member siblings. At the end of the initializa=
tion, the "<font face=3D"courier new, monospace">AA</font>" membe=
r of the "<font face=3D"courier new, monospace">s</font>" union i=
s initialized. The "<font face=3D"courier new, monospace">y</font>&quo=
t; sub-member is set to an enumeration, but does the "<font face=3D"co=
urier new, monospace">x</font>" sub-member join the other sub-members =
in being value-initialized, or is the first initialization clause reinstate=
d (although it was voided by the second)?<br>
</div><div><br></div><div>Hopefully, someone in C's version of the work=
ing group committees has already asked this, since it doesn't seem to b=
e covered in C99. (Maybe C11 already has a resolution.)</div></div></blockq=
uote>
<div><br></div><div>IIRC C has a DR on this.</div></div></div></div></block=
quote><div><br></div></div><div>I took a quick glance at ISO's WG 14 pa=
ge (the C group, like ours is WG 21), and I didn't see it. (None of the=
titles suggested anything about the designation feature.) Their group is r=
eally small, like the issues and proposals counts are orders of magnitude s=
maller! Was I looking at the wrong page?</div>
</div></blockquote><div><br></div><div>The closest I can find is:</div><div=
><br></div><div>=A0 <a href=3D"http://www.open-std.org/jtc1/sc22/wg14/www/d=
ocs/dr_253.htm">http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm<=
/a><br>
</div><div><br></div><div>But that doesn't cover this case. The discuss=
ion I was thinking of was this:</div><div><br></div><div>=A0 <a href=3D"htt=
p://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html">http://=
lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html</a><br>
</div><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);borde=
r-left-style:solid;padding-left:1ex"><div dir=3D"ltr"><div>Or maybe no DR m=
entioned it because it was resolved in C11. Does anyone here have a copy?</=
div>
</div></blockquote><div><br></div><div>Yes, and C11 seems to have the same =
wording hole.=A0</div></div></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" 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 />
--047d7b5db26a42a6d704e9d1179a--
.