I don't like slices in D
Jakob Ovrum
jakobovrum at gmail.com
Fri Oct 18 20:49:50 PDT 2013
On Saturday, 19 October 2013 at 03:46:52 UTC, Jakob Ovrum wrote:
> By avoiding the concatenation operators and expansion through
> increasing the length property, slices can be used separately
> from the runtime's opaque dynamic array type. Slices can be
> backed by any memory by slicing a pointer or fixed-length
> array. Also, slices with compile-time initializers are backed
> either by TLS or global memory.
Also, string literals are backed by global memory (sometimes ROM).
> There is also one incidence in the language where such a
> non-runtime-backed slice appears implicitly:
To clarify: there is one incidence where a slice of *stack
memory* is implicitly created.
More information about the Digitalmars-d
mailing list