An unfortunate "misfeature"

0ffh frank at frankhirsch.youknow.what.todo.net
Thu Dec 27 16:56:23 PST 2007


Hxal wrote:
> Personally I'd be happy if array literals were allocated in the read-only data section
> and on the stack (for dynamic initializers). There's always the [1, 2, 3].dup syntax for
> allocating on the heap. But that kind of change might break a lot of existing code.

Well, just in case you are interested, I was curious and patched
Phobos to use a single preallocated buffer for array literals. =)
It seems to work, and I suppose the same could be done for Tango.

regards, frank



More information about the Digitalmars-d mailing list