OpSlice for Ndim arrays?
Ivan Senji
ivan.senji_REMOVE_ at _THIS__gmail.com
Sat Mar 11 03:11:59 PST 2006
Oskar Linde wrote:
...
>
> void main() {
> int a = 1;
> float b = 5.6;
> long c = 3;
> char[] d = "test";
> func(a,b,c,d);
> }
>
> ---
>
> And guess what? This prints:
>
> Got argument: (int) 1
> Got argument: (float) 5.6
> Got argument: (long) 3
> Got argument: (char[]) test
> Done!
>
> All types are deduced at compile time!
>
> Notice the neat implementation of realFunc(). All other templates could be
> put in a library. I bet the func()-wrapper could declared by a mixin!
>
> So all we need to support multidimensional splice/indexing is to make ..
> evaluate into:
>
> struct Sequence {
> size_t start,end;
> }
>
> and we are set.
>
I kind of like the idea, but not sure if it is maybe to late for
something like that, and not sure if it will cause any problems.
More information about the Digitalmars-d
mailing list