No , there is nothing that will simplify your code without overloading the benefits of reading with a large performance penalty.
:
, :
(: -, , , generics varargs, , , . int, .)
static bool AllEqual(int value, __arglist)
{
for (var ai = new ArgIterator(__arglist); ai.GetRemainingCount() > 0; )
{
var next = __refvalue(ai.GetNextArg(typeof(int).TypeHandle), int);
if (!value.Equals(next)) { return false; }
}
return true;
}
:
bool equal = AllEqual(1, __arglist(1, 1, 1));
: , , , .:)