Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #729

Re: N3242 8.5.1/15 -- braced union declarations limited only to first member

X-Received by 10.70.38.3 with SMTP id c3mr911738pdk.7.1411000203110; Wed, 17 Sep 2014 17:30:03 -0700 (PDT)
MIME-Version 1.0
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!h15no509653igd.0!news-out.google.com!ht4ni15785igb.0!nntp.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Wed, 17 Sep 2014 19:30:02 -0500
Return-Path <cppmods@glengoyne.dreamhost.com>
Sender std-cpp-request@vandevoorde.com
Approved james.dennett@gmail.com
Message-ID <a49b07f5-e922-4e9e-977a-cb9dddd86928@googlegroups.com> (permalink)
Newsgroups comp.std.c++
From Philip Guenther <guenther@googlemail.com>
Subject Re: N3242 8.5.1/15 -- braced union declarations limited only to first member
Organization unknown
References <3bd8af8c-bcd3-4fca-a7ce-3e1a3e1dc21b@googlegroups.com> <0afb2699-65e9-4a05-9f0b-c8bae7a18ad9@googlegroups.com>
X-Original-Date Tue, 16 Sep 2014 20:10:39 -0700 (PDT)
X-Submission-Address std-cpp-submit@vandevoorde.com
To undisclosed-recipients:;
Date Wed, 17 Sep 2014 19:29:09 CST
Lines 38
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-gJZ1xLnDVaWQ9rp4XVLD3wyrxQVstQIZhFDUDtF2UsakdEE7/3eppbGtxOiT32vN6NiHEi7/CxbPAb0!1c+11ufvNpEjkKQaKdWKqiN9XK3otOd3yDP72kCzWw0aX93A+0Ri1WnoIPtcAD//oZ04ico2vo6z!pvj0e3XKMms=
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2590
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.std.c++:729

Show key headers only | View raw


On Tuesday, September 16, 2014 7:10:03 PM UTC-7, Rick C. Hodgin wrote:
> On Saturday, August 30, 2014 2:30:01 PM UTC-4, Rick C. Hodgin wrote:
> > Taken from:
> > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf
> >
> > ----------
> > 8.5.1 / 15 When a union is initialized with a brace-enclosed initializer,
> > the braces shall only contain an initializer-clause for the first non-
> > static data member of the union.
> >
> > [ Example:
> > union u { int a; const char* b; };
> > u a = { 1 };
> > u b = a;
> > u c = 1; // error
> > u d = { 0, "asdf" }; // error
> > u e = { "asdf" }; // error
> > --end example ]
> > ----------
>
>
> If no one objects, I propose this limitation be removed and replaced
> with an allowance for compile-time initializer clauses to any union
> member.

Don't C99 designated initializers solve this problem?


Philip Guenther


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

N3242 8.5.1/15 -- braced union declarations limited only to first member rick.c.hodgin@googlemail.com - 2014-08-30 13:29 -0600
  Re: N3242 8.5.1/15 -- braced union declarations limited only to first member "Rick C. Hodgin" <rick.c.hodgin@googlemail.com> - 2014-09-16 21:01 -0600
    Re: N3242 8.5.1/15 -- braced union declarations limited only to first member Philip Guenther <guenther@googlemail.com> - 2014-09-17 19:29 -0600
      Re: N3242 8.5.1/15 -- braced union declarations limited only to first member "Rick C. Hodgin" <rick.c.hodgin@googlemail.com> - 2014-09-19 01:06 -0600
        Re: N3242 8.5.1/15 -- braced union declarations limited only to first member "Rick C. Hodgin" <rick.c.hodgin@googlemail.com> - 2014-09-20 01:37 -0600
          Re: N3242 8.5.1/15 -- braced union declarations limited only to first member Martin Bonner <martinfrompi@yahoo.co.uk> - 2014-09-23 14:52 -0600
            Re: N3242 8.5.1/15 -- braced union declarations limited only to first member "Rick C. Hodgin" <rick.c.hodgin@googlemail.com> - 2014-09-24 16:30 -0600
      Re: N3242 8.5.1/15 -- braced union declarations limited only to first  member James Kuyper <jameskuyper@verizon.net> - 2014-09-19 01:06 -0600
      Re: N3242 8.5.1/15 -- braced union declarations limited only to first member Francis Glassborow <Francis.glassborow@btinternet.com> - 2014-09-19 01:06 -0600

csiph-web