CPP 1.3 MAILINGLIST Avatar
  1. OMG Issue

CPP13 — unspecified criterion for Any extraction

  • Key: CPP13-46
  • Legacy Issue Number: 3603
  • Status: open  
  • Source: Cisco Systems ( Paul Kyzivat)
  • Summary:

    The C++ language mapping does not specify what criterion should be used to
    determine the validity of a typesafe extraction from an Any.

    The closest it ever comes is the statement in 1.16.3:
    "In this case, the version of operator>>= for type Long must be able to
    determine whether the Any truly does contain a value of type Long...".

    There are two obvious candidates: the equal and equivalent operations of
    TypeCode.

    Proposed resolution:

    Replace the first sentence of 1.16.3:

    "To allow type-safe retrieval of a value from
    an any, the mapping provides the following
    operators for each OMG IDL type T:"

    with:

    To allow type-safe retrieval of a value
    from an Any, the mapping provides an
    operator>>= for each OMG IDL type T.
    Each such operator returns a boolean
    indicating success or failure, and if
    successful, makes the value of the any
    available via a user supplied argument.
    The success of the operation is determined
    by applying the

    {equal | equivalent}
    operation to the typecode of the any and
    the typecode of the target type.

    The exact form of operator>>= varies
    according to the type T as follows:

    The choice of {equal | equivalent}

    needs to be discussed. I believe there
    are valid arguments for each.

  • Reported: CPP 1.1 — Tue, 9 May 2000 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT