Type Summary

						public interface ICloneable
{
  // Methods
     object Clone ();
}

JR The documentation for this interface states that Clone can make either a shallow or deep copy. This is ridiculous; the standard should have defined Clone as making a deep copy. Without a guarantee of the type of copy, you must be careful how you use a cloned object and have intimate knowledge of what Clone does for a type; this information is usually not documented, leading to problems.

KG Echoing Jeffrey's comment, without a contract for ICloneable, which specifies whether it is deep or shallow, this interface is close to unusable. Defining a deep-copy version would have definitely been the most useful approach here.

Because of this loose contract, anyone utilizing ...

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.