overloading operators for I/O

nazo lovesyao at gmail.com
Thu Feb 15 00:56:54 PST 2007


I didn't see all posts. but "stdout ~= tuple(a,b,c,d)" is best for 
Output, I think. and need more short tuple syntax like a:b:c:d.

Example:
stdout ~= a:b:c:d; //call stdout.opCat(a,b,c,d)
stdout ~= e:f;
stdout ~= g:h;

I have no idea for Input best solution without opPopAssign_r.

Example:
int a; char[] b;
a:b = stdin.pop; //call stdin.opPopAssign_r!(typeof(a:b))();
                  //return type is typeof(a:b).
                  //"decide template from return type" is needed.

These ideas have problem for binary size :-(
#Sorry for my poor English



More information about the Digitalmars-d mailing list