function pointer
I need to have some kind of array of function pointer, which can be pretty big, how to encapsulate a managed Function Pointer like a Delegate, with support of arguments by ref ?
delegate is just a way to basically alias the type of a Func or Action, whether you assign a lambda to it, or an existing method, is up to youFunc<>, Action<> and delegate areCompile: 449.975ms | Execution: 23.616ms | React with ❌ to remove this embed.
delegatedelegateFuncActionFunc<>Action<>8delegate int Foo(ref int x);
var foos = new Foo[]{
(ref int x) => x * 2,
(ref int x) => x * 3
};unsafe {
Console.Write(sizeof(Func<int,int>));
}