On Friday, 4 July 2014 at 21:09:05 UTC, Remo wrote:
By "C++ style memory management" I do not mean naked new/delete or malloc/free.
What I mean is RAII, smart pointers and destructor's.
What is the proper replacement for std::unique_ptr and std::shared_ptr in D2 ?
Of course with move support for unique_ptr :)

Ah, I see what you mean now. D has that:

http://dlang.org/phobos/std_typecons.html#.Unique
http://dlang.org/phobos/std_typecons.html#.RefCounted

But they probably need some decent updating for use with @nogc and more modern D style, though.

Also the Unique pointer also works with std.algorithm.move (in addition to its "release" method which could be deprecated, I think... not sure why it needs it when we have std.algorithm.move).

Reply via email to