On 2/10/12 11:42 AM, Martin Nowak wrote:
On Fri, 10 Feb 2012 16:35:18 +0100, kenji hara <[email protected]> wrote:

I think std.typecons.Unique should place the object ownership under
the control.
Unique!T holds the unique ownership of given object typed T.
yes, Unique can hold an object on heap, but also should be able to
hold stack allocated object.
(In this case, Unique!T will work as rebindable scoped!T, IMO)

An experimental implementation of mine.
https://github.com/9rnsr/scrap/blob/master/typecons/unique.d

Kenji Hara

Can you give an example where a unique value type is useful.

Transferring ownership across threads. Thanks Kenji for working on this. An essential aspect will be to get the move right.

Andrei

_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to