Last active
December 5, 2016 09:50
-
-
Save controlflow/2f388683c4cd990a0be60b97aead7eb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class ArgListFun { | |
static void Main() { | |
var arg2 = 1; | |
string arg3; | |
var arg1 = M(__arglist(123, ref arg2, out arg3)); | |
Console.WriteLine(arg1); // 123 | |
Console.WriteLine(arg2); // 43 | |
Console.WriteLine(arg3); // "abc" | |
} | |
static int M(__arglist) { | |
var iterator = new ArgIterator(__arglist); | |
var arg1 = __refvalue(iterator.GetNextArg(), int); | |
__refvalue(iterator.GetNextArg(), int) += 42; | |
__refvalue(iterator.GetNextArg(), string) = "abc"; | |
return arg1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
__arglist, __refvalue,__makeref and __reftype keywords available in earlier versions