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
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
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
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
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
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
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