Re: Getting RefCounted to work with classes

2014-08-26 Thread uri via Digitalmars-d-learn
On Monday, 25 August 2014 at 21:14:03 UTC, Bienlein wrote: Hello, the code below compiles and runs fine. However, when I change Payload from struct to class I get compiler errors: Error 1 Error: template instance std.typecons.RefCounted!(Payload, cast(RefCountedAutoInitialize)1) does not

Re: Getting RefCounted to work with classes

2014-08-26 Thread Bienlein via Digitalmars-d-learn
On Tuesday, 26 August 2014 at 06:01:25 UTC, uri wrote: RefCounted does not work with classes. Classes are reference types already. Yep, that's the problem. I also got some suspicion, then surfed the Internet and found the information about it. Thanks for explaining the error message to me.

Getting RefCounted to work with classes

2014-08-25 Thread Bienlein via Digitalmars-d-learn
Hello, the code below compiles and runs fine. However, when I change Payload from struct to class I get compiler errors: Error 1 Error: template instance std.typecons.RefCounted!(Payload, cast(RefCountedAutoInitialize)1) does not match template declaration RefCounted(T,