<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
I'm next person, which isn't necessarily happy about delete operator
deprecation. <br>
Because constructors / destructors are frequently used not only for
application controlled memory management, how would You implement
something like following code without delete operator?<br>
<br>
<code><br>
void main(string[] args) {<br>
auto res = new Resource();<br>
auto s1 = new FirstSystem(res);<br>
delete s1;<br>
auto s2 = new SecondSystem(res);<br>
}<br>
class FirstSystem {<br>
this(Resource res) {<br>
res.referenced = true;<br>
}<br>
~this() {<br>
res.referenced=false;<br>
}<br>
}<br>
class SecondSystem {<br>
this(Resource res) {<br>
assert(!res.referenced);<br>
}<br>
}<br>
</code><br>
<br>
Next questions would be:<br>
* Are you going to drop destructor as well, or maybe destructor is
going to be confusing feature with non-deterministic behaviour? (How
would i know when heap allocated Socket will be destructed ->
when connection will be closed -> if my system gonna be DoS'ed?)<br>
* Are you going to stop supporting object oriented programming?
(Well, if *deterministic* resource managing can be only inside
function, and not object boundaries, that's my conclusion).<br>
<br>
And finally, don't get me wrong. I'm just <span
class="Apple-style-span" style="border-collapse: separate; color:
rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
font-size: medium;"><span class="Apple-style-span"
style="font-family: arial,sans-serif; font-size: 13px;
white-space: nowrap;">caricaturizing</span></span> my current
worries about the language, and if I'm missing something - please
hint me what.<br>
<br>
Sincerely,<br>
Mariusz Gliwiński<br>
</body>
</html>