<div class="gmail_quote">On Fri, Aug 5, 2011 at 11:35 PM, Mehrdad <span dir="ltr"><<a href="mailto:wfunction@hotmail.com">wfunction@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I think D should really have a friendlier interface to stack-based data structures than just alloca() (unless it already does and I don't know about it).<br>
<br>
Some features which I think would be helpful:<br>
- An "automatic" array-like structure entirely on the stack that starts out with a capacity given by the user), and which switches to the heap if it gets too big.<br>
- A function that can just allocate a structure easily on the stack, taking care of constructors and whatnot... something like alloca!Foo() to allocate Foo on the stack, and alloca!Foo(5) to allocate Foo[] with a length of 5 on the stack (NOT Foo[5], obviously...), etc.<br>


<br>
How does this sound?<br></blockquote><div><br></div><div><a href="http://d-programming-language.org/phobos/std_typecons.html#scoped">http://d-programming-language.org/phobos/std_typecons.html#scoped</a></div></div><br>