Re: Can opApply be made @nogc?

2018-10-21 Thread welkam via Digitalmars-d-learn
DIP 1000 says: Delegates currently defensively allocate closures with the GC. Few actually escape, and with scope only those that actually escape need to have the closures allocated. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md#benefits

Re: Can opApply be made @nogc?

2018-10-19 Thread Alex via Digitalmars-d-learn
On Friday, 19 October 2018 at 23:32:44 UTC, solidstate1991 wrote: Since it's a bit difficult to make tree traversal through range (especially if someone wants to make it @nogc), I thought I'll make it through opApply override, however the delegate passed by it doesn't have the @nogc attribute,

Re: Can opApply be made @nogc?

2018-10-19 Thread rikki cattermole via Digitalmars-d-learn
On 20/10/2018 12:32 PM, solidstate1991 wrote: Since it's a bit difficult to make tree traversal through range (especially if someone wants to make it @nogc), I thought I'll make it through opApply override, however the delegate passed by it doesn't have the @nogc attribute, which would automati

Can opApply be made @nogc?

2018-10-19 Thread solidstate1991 via Digitalmars-d-learn
Since it's a bit difficult to make tree traversal through range (especially if someone wants to make it @nogc), I thought I'll make it through opApply override, however the delegate passed by it doesn't have the @nogc attribute, which would automatically make it incapable to be used in a @nogc