CPP 1.3 NO IDEA Avatar
  1. OMG Issue

CPP13 — Construction of _var types

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

    the spec says (on page 1-23):

    The T* constructor creates a T_var that, when destroyed, will
    delete the storage pointed to by the T* parameter. The parameter
    to this constructor should never be a null pointer. Compliant
    implementations are not required to detect null pointers passed
    to this constructor.

    This seems broken for two reasons:

    • In an environment without real exceptions, null pointers must
      be returned for variable-length types in the presence of an
      exception. So if I write

    Foo_var fv(some_ref->op(my_corba_environment));

    and op() raises an exception (which will be returned in the
    environment), I'm hosed.

    • The assignment operator permits assignment of null, but the
      constructor doesn't. This is inconsistent, if nothing else.

    It seems that disallowing initialization from null pointer is some
    historical hangover? I think the restriction should be removed.

  • Reported: CPP 1.1 — Tue, 25 Jan 2000 05:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT