3 ms·
EVen in .net that HAS variadics, there are no stack allocated variadics (yet) so you'll often see 8 overloads with foo(T arg1) foo (T arg1, T arg2) foo(T arg
by alkonaut 5y ago
EVen in .net that HAS variadics, there are no stack allocated variadics (yet) so you'll often see 8 overloads with foo(T arg1) foo (T arg1, T arg2) foo(T arg1, T arg2, T arg3) and so on up to foo(params T[] args) because you want to avoid the overhead of actully allocating an array only to pass to one method, if you can. You'd think this kind of thing could be unfolded at compile time instead of requiring manual overloads.