DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="0.1.0" />

 ValueTypeExtensions

public static class ValueTypeExtensions
Various extensions for value types.
public static void BitCast<FROM, TO>(this FROM input, out TO output) where FROM : ValueType modreq(System.Runtime.InteropServices.UnmanagedType) where TO : ValueType modreq(System.Runtime.InteropServices.UnmanagedType)

Obtain a value of type TO by reinterpreting the object representation of FROM.

Obtain a value of type TO by reinterpreting the object representation of FROM.

public static ValueType<T> Box<T>(this T value) where T : struct

Create boxed representation of the value type.

public static bool IsOneOf<T>(this T value, IEnumerable<T> values) where T : struct, IEquatable<T>

Checks whether the specified value is equal to one of the specified values.

public static bool IsOneOf<T>(this T value, T[] values) where T : struct, IEquatable<T>

Checks whether the specified value is equal to one of the specified values.