Increment
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace DotNext.Threading
{
[StructLayout(LayoutKind.Auto)]
internal readonly struct Increment : 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);
}
}
}