How can one copy an IPAddress? There doesn't seemt to be a copy constructor or assignment operator or public Copy() member of any kind.
Does one really have to use IPAddress::GetAddressBytes() like this (C++/CLI):
IPAddress^ orig = gcnew IPAddress(IPAddress::None);
IPAddress^ copy = gcnew IPAddress(orig->GetAddressBytes());
That seems rather obtuse. Is there a more obvious/elegant way? Should there be?
[ADDITION]
And, now that I notice the "ScopeId" property, it doesn't seem that the above snippet even works. One must be sure to grab that as well:
IPAddress^ copy = gcnew IPAddress(orig->GetAddressBytes(), orig->ScopeId);
That seems even less elegant. And also out-right wrong if/when any other properties are added to the class in the future. Hence the reason classes should encapsulate their own copy symantecs, I would think.