Re: Fixed-size arrays on the heap

2010-05-06 Thread Pelle
On 05/06/2010 01:10 PM, bearophile wrote: Lars T. Kyllingstad: In particular, note Kasumi Hanazuki's post and Andrei's response to it. Thank you, it seems Andrei agrees with me. But I think here thinks have to be kept tidy, otherwise it's easy to make a mess. The syntax offers various intere

Re: Fixed-size arrays on the heap

2010-05-06 Thread bearophile
Lars T. Kyllingstad: > In particular, note Kasumi Hanazuki's post and Andrei's response to it. Thank you, it seems Andrei agrees with me. But I think here thinks have to be kept tidy, otherwise it's easy to make a mess. The syntax offers various interesting possibilities for a future Internation

Re: Fixed-size arrays on the heap

2010-05-06 Thread Lars T. Kyllingstad
On Thu, 06 May 2010 06:37:20 -0400, bearophile wrote: > While translating some old code I have found that allocating a > fixed-size array on the heap is not allowed, do you know why? I don't know, but it was discussed not too long ago: http://www.digitalmars.com/d/archives/digitalmars/D/ elimina

Fixed-size arrays on the heap

2010-05-06 Thread bearophile
While translating some old code I have found that allocating a fixed-size array on the heap is not allowed, do you know why? template Arr(int N) { alias int[N] Arr; } void main() { auto p = new Arr!(10); } The compiler says: test.d(5): Error: new can only create structs, dynamic arrays