On Thursday, 15 December 2022 at 20:12:12 UTC, Ali Çehreli wrote:
I think this is a bug because the documentation clearly talks
about destroying the object:
OK: https://github.com/dlang/phobos/pull/8651
> do we need to do some kind of deprecation?
The behavior is so different from the inten
On 12/15/22 11:31, Nick Treleaven wrote:
> On Wednesday, 14 December 2022 at 17:41:07 UTC, Ali Çehreli wrote:
>> I've never used Unique but I think it has a bug (or a design issue?):
>> Its destructor is the following:
>>
>> ~this()
>> {
>> if (_p !is null)
>> {
>>
On Wednesday, 14 December 2022 at 17:41:07 UTC, Ali Çehreli wrote:
I've never used Unique but I think it has a bug (or a design
issue?): Its destructor is the following:
~this()
{
if (_p !is null)
{
destroy(_p);
_p = null;
}
}
Because
On Monday, 2 October 2017 at 09:34:29 UTC, Andrea Fontana wrote:
Anyway: you cant put a default destructor on struct
True. In which case you should either @disable this() (which
presents its own set of issues) or hide b behind a @property
function, something like:
struct S {
B _b;
On Monday, 2 October 2017 at 09:08:59 UTC, Biotronic wrote:
Not knowing what you're attempting to do, I'm not sure how to
fix your problem. But if what I've described above does indeed
cover it, initializing b in the constructor is the way to get
it to work.
--
Biotronic
Obviusly real exa
On Monday, 2 October 2017 at 08:47:47 UTC, Andrea Fontana wrote:
Why this code doesn't write two identical lines?
https://dpaste.dzfl.pl/e99aad315a2a
Andrea
A reduced example of where it goes wrong:
class B {}
struct A {
B b = new B;
}
unittest {
A a1, a2;
assert(a1 == a2);
}
Why this code doesn't write two identical lines?
https://dpaste.dzfl.pl/e99aad315a2a
Andrea