// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
namespace System.Json
{
///
/// Struct that wraps values which cause JIT compilation at runtime.
/// This Struct is added to solve the FxCop warning CA908 in JsonObject.cs.
///
/// Wrapped type.
internal struct NGenWrapper
{
///
/// Value of type T which represents the actual data which is currently in hold.
///
public T Value;
///
/// Creates an instance of the class
///
/// The wrapped object of T
public NGenWrapper(T value)
{
Value = value;
}
///
/// Cast operator from to
///
/// Object in type
/// Object in type The wrapped element type
/// The wrapped element type
public static implicit operator T(NGenWrapper value)
{
return value.Value;
}
///
/// Cast operator from to
///
/// Object in type
/// Object in type
/// The wrapped element type
public static implicit operator NGenWrapper(T value)
{
return new NGenWrapper(value);
}
}
}