Re: Allocating a slice object

2013-07-08 Thread monarch_dodra
On Monday, 8 July 2013 at 15:43:21 UTC, Marco Leise wrote: Am Thu, 04 Jul 2013 15:54:48 +0200 schrieb "monarch_dodra" : > This should work: > > int[] *pSlice = (new int[][1]).ptr; > > -Steve Hum... That would allocate a dynamic array of slices though right? There'd be the Appendable overhead

Re: Allocating a slice object

2013-07-08 Thread Marco Leise
Am Thu, 04 Jul 2013 15:54:48 +0200 schrieb "monarch_dodra" : > > This should work: > > > > int[] *pSlice = (new int[][1]).ptr; > > > > -Steve > > Hum... That would allocate a dynamic array of slices though > right? There'd be the Appendable overhead for just one element... No, it allocates a st

Re: Allocating a slice object

2013-07-04 Thread Jonathan M Davis
On Thursday, July 04, 2013 09:37:57 Steven Schveighoffer wrote: > On Thu, 04 Jul 2013 08:02:13 -0400, monarch_dodra > > wrote: > > This is a pretty stupid question, but how would you allocate an "int[]" > > on the heap? I'm not talking about the array, but the actual slice > > object. EG: > > >

Re: Allocating a slice object

2013-07-04 Thread monarch_dodra
On Thursday, 4 July 2013 at 13:37:52 UTC, Steven Schveighoffer wrote: On Thu, 04 Jul 2013 08:02:13 -0400, monarch_dodra wrote: This is a pretty stupid question, but how would you allocate an "int[]" on the heap? I'm not talking about the array, but the actual slice object. EG: int[]* pSlic

Re: Allocating a slice object

2013-07-04 Thread Steven Schveighoffer
On Thu, 04 Jul 2013 08:02:13 -0400, monarch_dodra wrote: This is a pretty stupid question, but how would you allocate an "int[]" on the heap? I'm not talking about the array, but the actual slice object. EG: int[]* pSlice = new int[]; //Error: new can only create structs, //dynamic array

Re: Allocating a slice object

2013-07-04 Thread Maxim Fomin
On Thursday, 4 July 2013 at 12:02:16 UTC, monarch_dodra wrote: This is a pretty stupid question, but how would you allocate an "int[]" on the heap? I'm not talking about the array, but the actual slice object. EG: int[]* pSlice = new int[]; //Error: new can only create structs, //dynamic array

Allocating a slice object

2013-07-04 Thread monarch_dodra
This is a pretty stupid question, but how would you allocate an "int[]" on the heap? I'm not talking about the array, but the actual slice object. EG: int[]* pSlice = new int[]; //Error: new can only create structs, //dynamic arrays or class objects, not int[]'s Is there a simple "idiomatic" w