RefCounted is ok
If GC methods it calls are legal during collection.
Unique is probably not good for database connection: you then
can't have connection in two variables, also if it holds a
reference to GC-allocated memory, it can't be put to GC-allocated
memory, since when that GC-allocated memory is collected, Unique
will try to destroy its possibly already fr
Awesome, thank you!
On Thursday, 9 March 2017 at 00:47:48 UTC, Adam D. Ruppe wrote:
Now, if you forget to scope(exit), it is OK, the garbage
collector WILL get around to it eventually, and it is legal to
work with C handles and functions from a destructor. It is only
illegal to call D's garbag
On Wednesday, 8 March 2017 at 23:54:56 UTC, Chad Joan wrote:
What's the best way to implement such a range in current D?
I'd go with a struct with disabled copying and default
construction, then make the destructor free it and the function
that returns it populate it.
So basically Unique.