On Sunday, 4 October 2015 at 22:49:59 UTC, bitwise wrote:
And if I want to nest a class in a struct? or pass a class around? and still have deterministic destruction?

You can't nest a Scoped in a struct, and RefCounted doesn't work on a class.

It just shouldn't be this hard do such trivial things.

   Bit

I think you can get a lot of mileage from using the following:

http://dlang.org/phobos/std_conv.html#.emplace
http://dlang.org/phobos/std_typecons.html#.scoped
http://dlang.org/phobos/std_typecons.html#.Unique

Reply via email to