K
kevin_g_frey
Hello All,
I do in fact feel rather stupid asking this question, but I will ask
nonetheless:
What is the correct way for performing a memberwise copy of an object
under Managed C++?
To use a very simple example:
DateTimeFormatInfo* format_info = new DateTimeFormatInfo;
// want to copy the invariant info - this doesn't compile
*format_info = *DateTimeFormatInfo::InvariantInfo;
I am obviously missing something in my understanding...
The closest I have come to achieving this (which is not a memberwise
copy, anyway), is to use the Clone( ) method. Because MC++ does not
seem to support CoVariant return types, however, I have to do this:
DateTimeFormatInfo* format_info = static_cast< DateTimeFormatInfo* >(
DateTimeFormatInfo::InvariantInfo )
which simply looks atrocious for such a simple operation.
Thanks
Kevin
I do in fact feel rather stupid asking this question, but I will ask
nonetheless:
What is the correct way for performing a memberwise copy of an object
under Managed C++?
To use a very simple example:
DateTimeFormatInfo* format_info = new DateTimeFormatInfo;
// want to copy the invariant info - this doesn't compile
*format_info = *DateTimeFormatInfo::InvariantInfo;
I am obviously missing something in my understanding...
The closest I have come to achieving this (which is not a memberwise
copy, anyway), is to use the Clone( ) method. Because MC++ does not
seem to support CoVariant return types, however, I have to do this:
DateTimeFormatInfo* format_info = static_cast< DateTimeFormatInfo* >(
DateTimeFormatInfo::InvariantInfo )
which simply looks atrocious for such a simple operation.
Thanks
Kevin