www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - name variable function call

reply BCS <BCS pathlink.com> writes:
with struct literals and opImplictCast we have it


struct FnWithLotsOfArgs
{
	int lots;
	float of;
	char args;
	int opImplicitCast(){...}
}

int i = FnWithLotsOfArgs(args:'t', of:3.14, lots:5);

I think I remember that correctly
Oct 03 2007
parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"BCS" <BCS pathlink.com> wrote in message 
news:fe1b5s$2u9b$1 digitalmars.com...
 with struct literals and opImplictCast we have it


 struct FnWithLotsOfArgs
 {
 int lots;
 float of;
 char args;
 int opImplicitCast(){...}
 }

 int i = FnWithLotsOfArgs(args:'t', of:3.14, lots:5);

 I think I remember that correctly
Oh wow! Course it's a little "hidden" and you can counterintuitively instantiate that struct. But still.
Oct 04 2007