Re:Next C compiler is a D compiler: Introducing DMD's ImportC
by winrid on Wednesday November 02, 2022 @10:33PM
(#33446194)
Can you tell the D compiler to free a pointer returned from a C method when it goes out of scope? Like uniq_ptr
[ Parent
| on HN ]
Re:Next C compiler is a D compiler: Introducing DMD's ImportC
by boundchecked on Wednesday November 02, 2022 @10:39PM
(#33446234)
D has scopeguards similar to defer.
Re:Next C compiler is a D compiler: Introducing DMD's ImportC
by WalterBright on Thursday November 03, 2022 @01:20AM
(#33447329)
D can do RAII.
Re:Next C compiler is a D compiler: Introducing DMD's ImportC
by germandiago on Thursday November 03, 2022 @07:06AM
(#33449357)
via structs, right? As for classes you should not rely on it I recall.
Re:Next C compiler is a D compiler: Introducing DMD's ImportC
by pjmlp on Thursday November 03, 2022 @08:47AM
(#33450167)
You can stack allocate classes, and then they behave like structs.
https://dlang.org/blog/2017/07/07/go-your-own-way-part-one-t...