Skip to content

Instantly share code, notes, and snippets.

@OswaldHurlem
Created February 16, 2018 11:38
Show Gist options
  • Save OswaldHurlem/13d3ac5e36195456e6c6714c95d776fa to your computer and use it in GitHub Desktop.
Save OswaldHurlem/13d3ac5e36195456e6c6714c95d776fa to your computer and use it in GitHub Desktop.
namespace OHDelegate
{
/*<<<
for valCnt in range(0, 6):
for refCnt in range(1, 9 - valCnt):
suffix = "WithRef" if refCnt == 1 else "With#{refCnt}Refs"
typeParams = ["in TVal#{i}" for i in xrange(0, valCnt)] + ["TRef#{i}" for i in xrange(0, refCnt)]
angleBracketContents = ", ".join(typeParams)
params = ", ".join(["TVal#{i} v#{i}" for i in xrange(0, valCnt)] + ["ref TRef#{i} r#{i}" for i in xrange(0, refCnt)])
OUT("public delegate void Action#{suffix}<#{angleBracketContents}>(")
OUT(" #{params});")
OUT("public delegate TRet Func#{suffix}<#{angleBracketContents}, out TRet>(")
OUT(" #{params});")
>>>*/
public delegate void ActionWithRef<TRef0>(
ref TRef0 r0);
public delegate TRet FuncWithRef<TRef0, out TRet>(
ref TRef0 r0);
public delegate void ActionWith2Refs<TRef0, TRef1>(
ref TRef0 r0, ref TRef1 r1);
public delegate TRet FuncWith2Refs<TRef0, TRef1, out TRet>(
ref TRef0 r0, ref TRef1 r1);
public delegate void ActionWith3Refs<TRef0, TRef1, TRef2>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate TRet FuncWith3Refs<TRef0, TRef1, TRef2, out TRet>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate void ActionWith4Refs<TRef0, TRef1, TRef2, TRef3>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate TRet FuncWith4Refs<TRef0, TRef1, TRef2, TRef3, out TRet>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate void ActionWith5Refs<TRef0, TRef1, TRef2, TRef3, TRef4>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4);
public delegate TRet FuncWith5Refs<TRef0, TRef1, TRef2, TRef3, TRef4, out TRet>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4);
public delegate void ActionWith6Refs<TRef0, TRef1, TRef2, TRef3, TRef4, TRef5>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5);
public delegate TRet FuncWith6Refs<TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, out TRet>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5);
public delegate void ActionWith7Refs<TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, TRef6>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5, ref TRef6 r6);
public delegate TRet FuncWith7Refs<TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, TRef6, out TRet>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5, ref TRef6 r6);
public delegate void ActionWith8Refs<TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, TRef6, TRef7>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5, ref TRef6 r6, ref TRef7 r7);
public delegate TRet FuncWith8Refs<TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, TRef6, TRef7, out TRet>(
ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5, ref TRef6 r6, ref TRef7 r7);
public delegate void ActionWithRef<in TVal0, TRef0>(
TVal0 v0, ref TRef0 r0);
public delegate TRet FuncWithRef<in TVal0, TRef0, out TRet>(
TVal0 v0, ref TRef0 r0);
public delegate void ActionWith2Refs<in TVal0, TRef0, TRef1>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1);
public delegate TRet FuncWith2Refs<in TVal0, TRef0, TRef1, out TRet>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1);
public delegate void ActionWith3Refs<in TVal0, TRef0, TRef1, TRef2>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate TRet FuncWith3Refs<in TVal0, TRef0, TRef1, TRef2, out TRet>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate void ActionWith4Refs<in TVal0, TRef0, TRef1, TRef2, TRef3>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate TRet FuncWith4Refs<in TVal0, TRef0, TRef1, TRef2, TRef3, out TRet>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate void ActionWith5Refs<in TVal0, TRef0, TRef1, TRef2, TRef3, TRef4>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4);
public delegate TRet FuncWith5Refs<in TVal0, TRef0, TRef1, TRef2, TRef3, TRef4, out TRet>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4);
public delegate void ActionWith6Refs<in TVal0, TRef0, TRef1, TRef2, TRef3, TRef4, TRef5>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5);
public delegate TRet FuncWith6Refs<in TVal0, TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, out TRet>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5);
public delegate void ActionWith7Refs<in TVal0, TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, TRef6>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5, ref TRef6 r6);
public delegate TRet FuncWith7Refs<in TVal0, TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, TRef6, out TRet>(
TVal0 v0, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5, ref TRef6 r6);
public delegate void ActionWithRef<in TVal0, in TVal1, TRef0>(
TVal0 v0, TVal1 v1, ref TRef0 r0);
public delegate TRet FuncWithRef<in TVal0, in TVal1, TRef0, out TRet>(
TVal0 v0, TVal1 v1, ref TRef0 r0);
public delegate void ActionWith2Refs<in TVal0, in TVal1, TRef0, TRef1>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1);
public delegate TRet FuncWith2Refs<in TVal0, in TVal1, TRef0, TRef1, out TRet>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1);
public delegate void ActionWith3Refs<in TVal0, in TVal1, TRef0, TRef1, TRef2>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate TRet FuncWith3Refs<in TVal0, in TVal1, TRef0, TRef1, TRef2, out TRet>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate void ActionWith4Refs<in TVal0, in TVal1, TRef0, TRef1, TRef2, TRef3>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate TRet FuncWith4Refs<in TVal0, in TVal1, TRef0, TRef1, TRef2, TRef3, out TRet>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate void ActionWith5Refs<in TVal0, in TVal1, TRef0, TRef1, TRef2, TRef3, TRef4>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4);
public delegate TRet FuncWith5Refs<in TVal0, in TVal1, TRef0, TRef1, TRef2, TRef3, TRef4, out TRet>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4);
public delegate void ActionWith6Refs<in TVal0, in TVal1, TRef0, TRef1, TRef2, TRef3, TRef4, TRef5>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5);
public delegate TRet FuncWith6Refs<in TVal0, in TVal1, TRef0, TRef1, TRef2, TRef3, TRef4, TRef5, out TRet>(
TVal0 v0, TVal1 v1, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4, ref TRef5 r5);
public delegate void ActionWithRef<in TVal0, in TVal1, in TVal2, TRef0>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0);
public delegate TRet FuncWithRef<in TVal0, in TVal1, in TVal2, TRef0, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0);
public delegate void ActionWith2Refs<in TVal0, in TVal1, in TVal2, TRef0, TRef1>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0, ref TRef1 r1);
public delegate TRet FuncWith2Refs<in TVal0, in TVal1, in TVal2, TRef0, TRef1, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0, ref TRef1 r1);
public delegate void ActionWith3Refs<in TVal0, in TVal1, in TVal2, TRef0, TRef1, TRef2>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate TRet FuncWith3Refs<in TVal0, in TVal1, in TVal2, TRef0, TRef1, TRef2, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate void ActionWith4Refs<in TVal0, in TVal1, in TVal2, TRef0, TRef1, TRef2, TRef3>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate TRet FuncWith4Refs<in TVal0, in TVal1, in TVal2, TRef0, TRef1, TRef2, TRef3, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate void ActionWith5Refs<in TVal0, in TVal1, in TVal2, TRef0, TRef1, TRef2, TRef3, TRef4>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4);
public delegate TRet FuncWith5Refs<in TVal0, in TVal1, in TVal2, TRef0, TRef1, TRef2, TRef3, TRef4, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3, ref TRef4 r4);
public delegate void ActionWithRef<in TVal0, in TVal1, in TVal2, in TVal3, TRef0>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, ref TRef0 r0);
public delegate TRet FuncWithRef<in TVal0, in TVal1, in TVal2, in TVal3, TRef0, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, ref TRef0 r0);
public delegate void ActionWith2Refs<in TVal0, in TVal1, in TVal2, in TVal3, TRef0, TRef1>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, ref TRef0 r0, ref TRef1 r1);
public delegate TRet FuncWith2Refs<in TVal0, in TVal1, in TVal2, in TVal3, TRef0, TRef1, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, ref TRef0 r0, ref TRef1 r1);
public delegate void ActionWith3Refs<in TVal0, in TVal1, in TVal2, in TVal3, TRef0, TRef1, TRef2>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate TRet FuncWith3Refs<in TVal0, in TVal1, in TVal2, in TVal3, TRef0, TRef1, TRef2, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate void ActionWith4Refs<in TVal0, in TVal1, in TVal2, in TVal3, TRef0, TRef1, TRef2, TRef3>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate TRet FuncWith4Refs<in TVal0, in TVal1, in TVal2, in TVal3, TRef0, TRef1, TRef2, TRef3, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2, ref TRef3 r3);
public delegate void ActionWithRef<in TVal0, in TVal1, in TVal2, in TVal3, in TVal4, TRef0>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, TVal4 v4, ref TRef0 r0);
public delegate TRet FuncWithRef<in TVal0, in TVal1, in TVal2, in TVal3, in TVal4, TRef0, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, TVal4 v4, ref TRef0 r0);
public delegate void ActionWith2Refs<in TVal0, in TVal1, in TVal2, in TVal3, in TVal4, TRef0, TRef1>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, TVal4 v4, ref TRef0 r0, ref TRef1 r1);
public delegate TRet FuncWith2Refs<in TVal0, in TVal1, in TVal2, in TVal3, in TVal4, TRef0, TRef1, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, TVal4 v4, ref TRef0 r0, ref TRef1 r1);
public delegate void ActionWith3Refs<in TVal0, in TVal1, in TVal2, in TVal3, in TVal4, TRef0, TRef1, TRef2>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, TVal4 v4, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
public delegate TRet FuncWith3Refs<in TVal0, in TVal1, in TVal2, in TVal3, in TVal4, TRef0, TRef1, TRef2, out TRet>(
TVal0 v0, TVal1 v1, TVal2 v2, TVal3 v3, TVal4 v4, ref TRef0 r0, ref TRef1 r1, ref TRef2 r2);
//<<>> (checksum: 23a3d388d7d638945ecd3b31757c21c7)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment