On 9/21/21 2:06 AM, Tejas wrote:
On Monday, 20 September 2021 at 18:13:53 UTC, Steven Schveighoffer wrote:
On 9/20/21 10:22 AM, Tejas wrote:
In case you still want to delete stuff deterministically despite what
Steve said, I suggest you make your `struct` a reference and use
On Monday, 20 September 2021 at 18:13:53 UTC, Steven
Schveighoffer wrote:
On 9/20/21 10:22 AM, Tejas wrote:
In case you still want to delete stuff deterministically
despite what Steve said, I suggest you make your `struct` a
reference and use `core.memory.__delete`(not recommended to
use this
On 9/20/21 10:22 AM, Tejas wrote:
In case you still want to delete stuff deterministically despite what
Steve said, I suggest you make your `struct` a reference and use
`core.memory.__delete`(not recommended to use this carelessly, btw)
Do not call `__delete` here, use `destroy`. `__delete`
On 9/20/21 5:23 AM, Learner wrote:
I was expecting S instance dtor called
S is being destructed
If you are sure the element can be destroyed, you can call destroy():
import std.stdio;
enum someSpecialInitValue = 777;
struct S
{
int i = someSpecialInitValue;
this(int i)
{
this.i
On Monday, 20 September 2021 at 14:03:09 UTC, Tejas wrote:
On Monday, 20 September 2021 at 13:48:01 UTC, Tejas wrote:
On Monday, 20 September 2021 at 12:23:00 UTC, Learner wrote:
[...]
I think it *is* being called:
```d
import std.stdio;
struct S
{
int a;
this(int param){
On Monday, 20 September 2021 at 13:48:01 UTC, Tejas wrote:
On Monday, 20 September 2021 at 12:23:00 UTC, Learner wrote:
[...]
I think it *is* being called:
```d
import std.stdio;
struct S
{
int a;
this(int param){
a = param;
}
~this()
{
On 9/20/21 8:23 AM, Learner wrote:
I was expecting something like going out of scope for that
```d
import std.stdio;
struct S
{
~this()
{
writeln("S is being destructed");
}
}
void main()
{
S[int] aa;
aa[1] = S();
aa.remove(1);
writeln("Why no dtor
On Monday, 20 September 2021 at 12:23:00 UTC, Learner wrote:
I was expecting something like going out of scope for that
```(D)
import std.stdio;
struct S
{
~this()
{
writeln("S is being destructed");
}
}
void main()
{
S[int] aa;
aa[1] = S();
aa.remove(1);
On Monday, 20 September 2021 at 12:23:00 UTC, Learner wrote:
I was expecting something like going out of scope for that
```(D)
import std.stdio;
struct S
{
~this()
{
writeln("S is being destructed");
}
}
void main()
{
S[int] aa;
aa[1] = S();
aa.remove(1);
I was expecting something like going out of scope for that
```(D)
import std.stdio;
struct S
{
~this()
{
writeln("S is being destructed");
}
}
void main()
{
S[int] aa;
aa[1] = S();
aa.remove(1);
writeln("Why no dtor call on remove?");
}
I was expecting
10 matches
Mail list logo