CPP 1.3 MAILINGLIST Avatar
  1. OMG Issue

CPP13 — Constructor for structures?

  • Key: CPP13-37
  • Legacy Issue Number: 3380
  • Status: open  
  • Source: Triodia Technologies Pty Ltd ( Michi Henning)
  • Summary:

    The mapping for user exceptions and structures is identical, except
    for one thing: user exceptions have an additional constructor with
    one parameter for each member, so I can construct and throw the exception
    with a single throw statement.

    However, structures are second-class citizens: I can't instantiate and
    initialize a structure at the same time. (Well, at least not in general,
    because static initialization only works for aggregates and, at any rate,
    I can only instantiate and initialize with compile-time constants.)

    So, why don't we add the same constructor to the mapping for structures?
    It seems inconsistent to have one mapping for structures and a slightly
    different one for exceptions, when in fact they both could be the same.

  • Reported: CPP 1.1 — Wed, 1 Mar 2000 05:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT