Auto Interation

janderson askme at me.com
Sat Sep 1 00:06:42 PDT 2007


Here's a random idea that I think may be a little bit much:

Auto Array iteration.

If you have a function like:

void foo(int x);

Then the language could allow you to use it on arrays like:

auto array = new int[];
foo(array);  //Iterate though every array
foo(5);  //One element like normal

foo(int[] x);  //Override array version of the operation to do something 
more optimal.

It may make logic errors more difficult to see, so scratch that idea.

Perhaps it could be done with some template syntax in a slightly more 
verbose way.



More information about the Digitalmars-d mailing list