#Should we need smart pointers?

1 messages · Page 1 of 1 (latest)

stone tusk
#

How about impl the smart pointers like c++ in a lib,does it make easy to manage memory?

low adder
#

it would need to be a language feature instead of part of the std since they rely on destructors. the general

var foo = bar.init(alloc);
defer foo.deinit()

is somewhat similar in a way

#

but i think automatic memory management like that wouldnt really fit with how zig does stuff

worthy field
#

I don't think it fits zig