Bug in RefCounted?
Rene Zwanenburg
renezwanenburg at gmail.com
Tue Oct 29 05:03:08 PDT 2013
On Monday, 28 October 2013 at 19:40:26 UTC, Maxim Fomin wrote:
> The fact that structs are movable and there is too few struct
> runtime reflection makes them noncollectable. However, you can
> wrap struct inside class, in such case struct dtor will be
> called.
Yeah, if wrapping inside a class wouldn't work either we'd be in
a whole new world of hurt.
But what do you exactly mean by noncollectable? And what does
movability have to do with that? I think the memory will be
reclaimed without a problem, so new-ing a struct without
destructor would be fine. This doesn't leak:
struct S
{
int i;
}
void main()
{
while(true)
{
new S;
}
}
More information about the Digitalmars-d-learn
mailing list