On 10/20/2013 5:59 PM, Jonathan M Davis wrote:
If that paradigm is frequent enough, it might be worth wrapping it in a struct. Then, you'd probably get something likeStaticArray!(int, 10) tmp(n); int[] a = tmp[]; which used T[10] if n was 10 or less and allocated T[] otherwise. The destructor could then deal with freeing the memory.
Sounds like a good idea - and it should fit in with Andrei's nascent allocator design.