Wrapping arbitrary values without boxing of common types.
- Take any value, including null
- Fit into 64bits of data and an object field (128bits total on x64)
- Do not box any primitive types (
int,float, etc.) [Except forDecimal] - Optimize performance for primitive type storage/retrieval
- Expose
Typeof wrapped type (ornullfor null) - Allow retrieving as any type that is
AssignableFrom - Support nullable intrinsics without boxing (
int?,float?, etc.) [Except forDecimal] - Allow intrinsic to/from nullable intrinsic (except no value to intrinsic)
- Support
ArraySegment<T>without boxing - Support UTC
DateTimeandDateTimeOffsetwithout boxing
This code has been included in Touki for both .NET Framework 4.7.2 and .NET 9.