Re: struct dynamic allocation error

2016-09-16 Thread Dechcaudron via Digitalmars-d
On Thursday, 15 September 2016 at 21:21:12 UTC, Steven Schveighoffer wrote: You need to destroy structs by passing them by reference. Passing a pointer just destroys the pointer. In this example, you can destroy what b points at (and call its destructor) via: destroy(*b); However, this will

Re: struct dynamic allocation error

2016-09-15 Thread Steven Schveighoffer via Digitalmars-d
On 9/15/16 4:38 PM, Dechcaudron wrote: I believe there is some kind of weird issue that won't allow for struct instances to be dynamically allocated in a proper way via the 'new' keyword. It does actually allocate them and return a valid pointer to operate the instances, but whenever the program

Re: struct dynamic allocation error

2016-09-15 Thread Ali Çehreli via Digitalmars-d
On 09/15/2016 01:38 PM, Dechcaudron wrote: I believe there is some kind of weird issue that won't allow for struct instances to be dynamically allocated in a proper way via the 'new' keyword. It does actually allocate them and return a valid pointer to operate the instances, but whenever the prog

Re: struct dynamic allocation error

2016-09-15 Thread Stefan Koch via Digitalmars-d
On Thursday, 15 September 2016 at 20:38:45 UTC, Dechcaudron wrote: I believe there is some kind of weird issue that won't allow for struct instances to be dynamically allocated in a proper way via the 'new' keyword. It does actually allocate them and return a valid pointer to operate the instan