On Mon, 03 Jan 2011 23:02:20 +0200, Steven Schveighoffer <[email protected]> wrote:

On Mon, 03 Jan 2011 15:33:10 -0500, so <[email protected]> wrote:

type of (&i)[0..1] is int[]

I see what the topic is all about.
The trouble is this syntax. You say it is int[], but i couldn't find anything in D reference that explains this.
Sorry if i am overlooking something.


Oh that:

http://www.digitalmars.com/d/2.0/arrays.html#slicing

quoted from there:


Slicing is not only handy for referring to parts of other arrays, but for converting pointers into bounds-checked arrays:

    int* p;
    int[] b = p[0..8];

The type of &i is int*, so there you go.

-Steve

Thanks a ton!
Another small but very important feature.

--
Using Opera's revolutionary email client: http://www.opera.com/mail/

Reply via email to