Gorgon
Show / Hide Table of Contents

Interface IGorgonCloneable<T>

A type safe version of the ICloneable interface.

Namespace: Gorgon.Core
Assembly: Gorgon.Core.dll
Syntax
public interface IGorgonCloneable<out T>
Type Parameters
Name Description
T

The type to clone.

Remarks

The .NET framework provides us with a ICloneable interface for objects that can be cloned. However, it returns the cloned object as a object type. This can introduce boxing issues for value types that implement ICloneable. This interface will allow us to mitigate the boxing issues by providing a strongly typed cloning interface.

Methods

| Edit this page View Source

Clone()

Function to clone an object.

Declaration
T Clone()
Returns
Type Description
T

The cloned object.

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author