DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.0.0-beta.9" />

 Adder

struct Adder : ISupplier<double, double, double>, ISupplier<float, float, float>, ISupplier<IntPtr, IntPtr, IntPtr>, ISupplier<int, int, int>, ISupplier<long, long, long>, ISupplier<uint, uint, uint>, ISupplier<ulong, ulong, ulong>
using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace DotNext.Threading { [StructLayout(LayoutKind.Auto)] internal readonly struct Adder : ISupplier<double, double, double>, ISupplier<float, float, float>, ISupplier<IntPtr, IntPtr, IntPtr>, ISupplier<int, int, int>, ISupplier<long, long, long>, ISupplier<uint, uint, uint>, ISupplier<ulong, ulong, ulong> { double ISupplier<double, double, double>.Invoke(double x, double y) { return x + y; } float ISupplier<float, float, float>.Invoke(float x, float y) { return x + y; } [return: System.Runtime.CompilerServices.NativeInteger] unsafe IntPtr ISupplier<IntPtr, IntPtr, IntPtr>.Invoke([System.Runtime.CompilerServices.NativeInteger] IntPtr x, [System.Runtime.CompilerServices.NativeInteger] IntPtr y) { return (IntPtr)(void*)((long)x + (long)y); } int ISupplier<int, int, int>.Invoke(int x, int y) { return x + y; } long ISupplier<long, long, long>.Invoke(long x, long y) { return x + y; } uint ISupplier<uint, uint, uint>.Invoke(uint x, uint y) { return x + y; } ulong ISupplier<ulong, ulong, ulong>.Invoke(ulong x, ulong y) { return x + y; } } }