resizeable arrays: T[new]
Sean Kelly
sean at f4.ca
Tue Jun 5 12:14:24 PDT 2007
Brad Roberts wrote:
> I believe that code would not need to change to retain existing behavior.
>
> The function args aren't const by default since it's not using 'in'. So
> it'll be fine. The syntax used is also to pass a slice. which would
> become non-resizeable, which you're not resizing, so that's fine. Slices
> are to retain their write through behavior, so that's fine. Your
> initialization of buf would have an implicit cast from dup's T[new] to
> buf's T[], which works. Passing a T[] to a function taking a T[] is
> perfectly normal..
>
> So, that code 'just works'.
Thanks for clearing this up. After thinking about the talk yesterday
I'd started to wonder if the "write through" feature of slices might
change, etc. It's very reassuring to know that this isn't the case.
Sean
More information about the Digitalmars-d-announce
mailing list