small idea

SH svaini at gmail.com
Wed Jan 9 07:02:01 PST 2013


This is actually one of the things I miss. In C# you have to
specify what direction the variables are traveling in the calling
function.

int a,b=2;

a_eq_b(a,b); // works..
a_eq_b(out a,b); // this would be nice
a_times2(ref a); // same here

void a_eq_b(out int a, int b)
{
    a = b;
}
void a_times2(ref int a)
{
    a *= 2;
}


More information about the Digitalmars-d mailing list