On 01/11/12 22:21, Dan wrote:
TDPL states
--
However, unlike in C++, clear does not dispose of the object’s
own memory and there is no delete operator. (D used to have a
delete operator, but it was deprecated.) You still can free
memory manually if you really, really know what you’re doing
TDPL states
--
However, unlike in C++, clear does not dispose of the object’s
own memory and there is no delete operator. (D used to have a
delete operator, but it was deprecated.) You still can free
memory manually if you really, really know what you’re doing by
calling the function
On 01-11-2012 22:21, Dan wrote:
TDPL states
--
However, unlike in C++, clear does not dispose of the object’s
own memory and there is no delete operator. (D used to have a
delete operator, but it was deprecated.) You still can free
memory manually if you really, really know what you’re doing
On 11/01/2012 02:21 PM, Dan wrote:
TDPL states
--
However, unlike in C++, clear does not dispose of the object’s
own memory and there is no delete operator.
Additionally, TDPL predates 'clear's deprecation in December 2012. It is
called 'destroy' now.
Ali
On Thursday, November 01, 2012 22:21:11 Dan wrote:
struct S {
int[] a; // array is privately owned by this instance
this(this) {
a = a.dup;
}
~this() {
delete a;
}
}
Is the delete call, then per TDPL not necessary? Is it harmful or
harmless?
It's not necessary at all. delete is