On Thu, 09 Jul 2009 20:24:16 -0400, Jarrett Billingsley <[email protected]> wrote:

On Thu, Jul 9, 2009 at 1:09 PM, Steven Schveighoffer<[email protected]> wrote:

Would something like this work?

(&data)[0..length]

Nope; &data is a char[0]*, and slicing it will get you a char[0][].
Which is pretty useless :D

d'oh!

Yeah, the only improvement I can make on your code then is:

(cast(char*)&data)[0..length];

Or the more general:

(cast(typeof(data[0])*)&data)[0..length]

Which still involves a cast. Crappy. Having the compiler do the right thing is a much better option :)

-Steve

Reply via email to