[phobos] Unique
Martin Nowak
dawg at dawgfoto.de
Fri Feb 10 11:42:14 PST 2012
On Fri, 10 Feb 2012 16:35:18 +0100, kenji hara <k.hara.pg at gmail.com> 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.
> 2012/2/10 Martin Nowak <dawg at dawgfoto.de>:
>> I'll take a shot at implementing std.typecons.Unique.
>> Any opinions or ideas?
>>
>> My main goals is that it should use malloc under the covers.
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
More information about the phobos
mailing list