Re: Attributes lost in TypeInfo, please advise

2015-02-13 Thread Steven Schveighoffer via Digitalmars-d
On 2/12/15 11:01 PM, Jakob Ovrum wrote: On Thursday, 12 February 2015 at 12:59:39 UTC, Steven Schveighoffer wrote: I think given the necessity of the above (which was not discussed or noticed in that bug report), we should add a way to call the true destructor properly in the compiler. I

Re: Attributes lost in TypeInfo, please advise

2015-02-12 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 12 February 2015 at 12:59:39 UTC, Steven Schveighoffer wrote: I think given the necessity of the above (which was not discussed or noticed in that bug report), we should add a way to call the true destructor properly in the compiler. -Steve I think these do the right thing with

Re: Attributes lost in TypeInfo, please advise

2015-02-12 Thread Steven Schveighoffer via Digitalmars-d
On 2/11/15 11:08 PM, Jakob Ovrum wrote: Consider the following: --- struct S { ~this() @safe {} } void foo() @safe { S s; // OK } void bar() @safe { S s; destroy(s); // test.d(15): Error: safe function 'test.bar' cannot call system function

Re: Attributes lost in TypeInfo, please advise

2015-02-12 Thread Benjamin Thaut via Digitalmars-d
On Thursday, 12 February 2015 at 12:59:39 UTC, Steven Schveighoffer wrote: I think given the necessity of the above (which was not discussed or noticed in that bug report), we should add a way to call the true destructor properly in the compiler. -Steve Yes please. Its also going to

Re: Attributes lost in TypeInfo, please advise

2015-02-11 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 12 February 2015 at 04:18:06 UTC, Adam D. Ruppe wrote: On Thursday, 12 February 2015 at 04:08:23 UTC, Jakob Ovrum wrote: Is it possible to call the destructor or postblit constructor directly yes, they are available as obj.__dtor() and obj.__postblit(); But... and will they

Attributes lost in TypeInfo, please advise

2015-02-11 Thread Jakob Ovrum via Digitalmars-d
Consider the following: --- struct S { ~this() @safe {} } void foo() @safe { S s; // OK } void bar() @safe { S s; destroy(s); // test.d(15): Error: safe function 'test.bar' cannot call system function 'object.destroy!(S).destroy' } --- `destroy` is used in algorithms

Re: Attributes lost in TypeInfo, please advise

2015-02-11 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 12 February 2015 at 04:08:23 UTC, Jakob Ovrum wrote: Is it possible to call the destructor or postblit constructor directly yes, they are available as obj.__dtor() and obj.__postblit(); But... and will they correctly destruct/copy recursively No. extern(C) @trusted void