On Wed, 21 Jan 2015 00:29:21 +0000
Kapps via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> On Tuesday, 20 January 2015 at 18:12:27 UTC, ketmar via 
> Digitalmars-d wrote:
> > let's see how this proposal will be rejected. will there be 
> > some sane
> > reasons, or only the good old song about "broken code"? make 
> > your bets!
> 
> Lots of functions can theoretically allocate, but don't in the 
> way you call them. For example, a function that checks for 
> invalid arguments and throws an exception if any are passed in. 
> It can't be @nogc because it throws, but it's perfectly valid to 
> call in a constructor.
nothing is valid with calling even potentially allocating function in
dtor.

> Also, what about classes allocated with malloc/emplace that are 
> then destroyed/freed?
that's easy: mark that destructors with proposed `@gc` attribute. this
way you will explicitly tell the compiler that you know what you're
doing here and taking all responsibility for your actions.

Attachment: signature.asc
Description: PGP signature

Reply via email to