Understanding RefCounted

2021-05-12 Thread JG via Digitalmars-d-learn
Reading the documentation on RefCounted I get the impression that the following can lead to memory errors. Could someone explain exactly how that could happen? I suppose that problem would be the call something to do with front? ``` private struct RefCountedRangeReturnType(R) { import std

Re: Understanding RefCounted

2021-05-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/12/21 3:28 AM, JG wrote: Reading the documentation on RefCounted I get the impression that the following can lead to memory errors. Could someone explain exactly how that could happen? I suppose that problem would be the call something to do with front? ``` private struct RefCountedRang

Re: Understanding RefCounted

2021-05-12 Thread JG via Digitalmars-d-learn
On Wednesday, 12 May 2021 at 13:38:10 UTC, Steven Schveighoffer wrote: On 5/12/21 3:28 AM, JG wrote: Reading the documentation on RefCounted I get the impression that the following can lead to memory errors. Could someone explain exactly how that could happen? I suppose that problem would be t

Re: Understanding RefCounted

2021-05-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/12/21 1:16 PM, JG wrote: On Wednesday, 12 May 2021 at 13:38:10 UTC, Steven Schveighoffer wrote: On 5/12/21 3:28 AM, JG wrote: Reading the documentation on RefCounted I get the impression that the following can lead to memory errors. Could someone explain exactly how that could happen? I s

Re: Understanding RefCounted

2021-05-12 Thread JG via Digitalmars-d-learn
On Thursday, 13 May 2021 at 00:53:50 UTC, Steven Schveighoffer wrote: On 5/12/21 1:16 PM, JG wrote: [...] Ah, ok. So reference counting provides a single thing you can point at and pass around without worrying about memory cleanup. But only as long as you refer to it strictly through a RefC