digitalmars.D - Any reason as to why this isn't allowed?
- Lass Safin (5/5) Apr 02 2016 class C {
- Paul O'Neil (3/8) Apr 02 2016 What do you expect the difference to be? I'm not sure what I expect the...
- Lass Safin (10/19) Apr 02 2016 It's more that I wish the immutable destructor to be empty, thus
- Marco Leise (5/11) Apr 04 2016 That is https://issues.dlang.org/show_bug.cgi?id=13628
class C { ~this() {} immutable ~this() {} } This gives a conflict error between the two destructors.
Apr 02 2016
On 04/02/2016 09:02 AM, Lass Safin wrote:class C { ~this() {} immutable ~this() {} } This gives a conflict error between the two destructors.What do you expect the difference to be? I'm not sure what I expect the semantics of destroying an immutable object to be.
Apr 02 2016
On Saturday, 2 April 2016 at 16:58:14 UTC, Paul O'Neil wrote:On 04/02/2016 09:02 AM, Lass Safin wrote:It's more that I wish the immutable destructor to be empty, thus never destroying it properly. I just don't really see the reason as to why we can have immutable and mutable constructors but not immutable and mutable destructors. Though currently it is possible if I create two functions, one immutable and one not, then set the value inside the vtable manually within two constructors, again, one immutable and one not.class C { ~this() {} immutable ~this() {} } This gives a conflict error between the two destructors.What do you expect the difference to be? I'm not sure what I expect the semantics of destroying an immutable object to be.
Apr 02 2016
Am Sat, 02 Apr 2016 13:02:18 +0000 schrieb Lass Safin <lasssafin gmail.com>:class C { ~this() {} immutable ~this() {} } This gives a conflict error between the two destructors.That is https://issues.dlang.org/show_bug.cgi?id=13628 -- Marco
Apr 04 2016