[omniORB] Any Copy Constructor
Carlos
carlos at canama.net
Fri Mar 23 01:28:06 GMT 2007
El mié, 21-03-2007 a las 17:30 +0100, Le Flour escribió:
> Hi all ,
> is there a way of making a deep copy of an Any type into another Any type ?
> Many thanks for your answers.
> Regards
> Thierry Le Flour
>
In page 1-66 of C++ Language Mapping Specification you have:
"The default constructor creates an Any with a TypeCode of type tk_null
and no value. The copy constructor calls _duplicate on the TypeCode_ptr
of its Any parameter and deep-copies the parameter’s value. The
assignment operator releases its own TypeCode_ptr and deallocates
storage for the current value if necessary, then duplicates the
TypeCode_ptr of its Any parameter and deep-copies the parameter’s
value. The destructor calls release on the TypeCode_ptr and deallocates
storage for the value, if necessary."
So
Any a = ....;
Any b(a);
or
Any b = a; // this calls copy constructor.
Cheers.
Carlos.
More information about the omniORB-list
mailing list