Decrement
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace DotNext.Threading
{
[StructLayout(LayoutKind.Auto, Size = 1)]
internal readonly struct Decrement : ISupplier<double, double>, ISupplier<float, float>, ISupplier<IntPtr, IntPtr>
{
double ISupplier<double, double>.Invoke(double value)
{
return value - 1;
}
float ISupplier<float, float>.Invoke(float value)
{
return value - 1;
}
[return: System.Runtime.CompilerServices.NativeInteger]
unsafe IntPtr ISupplier<IntPtr, IntPtr>.Invoke([System.Runtime.CompilerServices.NativeInteger] IntPtr value)
{
return (IntPtr)(void*)((long)value - 1);
}
}
}