June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
It's only true as long as you have full control of the source. Once... | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
Quite, but if you backtrack to my initial statement, it was about ptr not being... | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
On Saturday, 3 June 2017 at 20:13:30 UTC, Moritz Maxeiner wrote: Yes, it... | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
Calling std.algorithm.move is explicit programmer intent, I consider that about as accidental as... | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
Yep, that's exactly why I added the null check in the example. If the... | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
I'd say `.init` can easily happen accidentally. Especially when `@disable this(this);` is involved... | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
Of course, but AFAIK you'd need to explicitly assign it to an object, so... | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
`.init` is the corner case. `.init` is always there, even with `@disable this();`. | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
Well, the differences I spot are: - null check in destructor: That's just because I... | |||
June 03, 2017 Learn » Re: RAII pointers | |||
|---|---|---|---|
| |||
Thanks to Moritz and Stanislav for their examples, most useful. There are similarities (which I... | |||
Copyright © 1999-2021 by the D Language Foundation