PassthroughCloner
PassthroughCloner<T>.Instance passes value and reference as is.
// Create cloner
ICloner<int> cloner = PassthroughCloner<int>.Instance;
// Passthrough
int x = cloner.Clone(5);
PassthroughCloner.Create(type) creates passthrough cloner for type argument.
// Create cloner
ICloner<int> cloner = PassthroughCloner<int>.Instance;
// Passthrough
int x = cloner.Clone(5);
Full Example
Full example
using Avalanche.Utilities;
class passthroughcloner
{
public static void Run()
{
{
// <01>
// Create cloner
ICloner<int> cloner = PassthroughCloner<int>.Instance;
// Passthrough
int x = cloner.Clone(5);
// </01>
}
{
// <02>
// Create cloner
ICloner<int> cloner =
(ICloner<int>)
PassthroughCloner.Create(typeof(int));
// </02>
// Passthrough
int x = cloner.Clone(5);
}
}
}