September 10, 2015 Re: What is the difference between D and C++ regarding Unique, RefCounted and Scoped? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Kozák | On Thursday, 10 September 2015 at 12:34:54 UTC, Daniel Kozák wrote:
>
> On Thu, 10 Sep 2015 11:38:35 +0000
> "Gary Willoughby" <dev@nomad.so> wrote:
>
>> On Wednesday, 9 September 2015 at 23:22:49 UTC, ponce wrote:
>> > - RefCounted
>> >
>> > Only for D structs. std::shared_ptr works for all.
>>
>> RefCounted works with classes as well.
>>
>> http://dlang.org/phobos/std_typecons.html#.RefCounted
>
> struct RefCounted(T, RefCountedAutoInitialize autoInit =
> RefCountedAutoInitialize.yes) if (!is(T == class) && !is(T ==
> interface));
>
> if (!is(T == class) && !is(T ==interface)); // So it does not work
> with classes
Sorry my mistake.
|
Copyright © 1999-2021 by the D Language Foundation