On Sunday, 12 August 2018 at 01:39:21 UTC, ag0aep6g wrote:
On 08/11/2018 12:00 PM, Alex wrote:
[...]
[...]
[...]
[...]
 [...]
[...]
[...]

You can provide to overloads: one with @nogc, one without it. To keep it somewhat DRY, you can let them forward to a template implementation:

    int opApply(scope int delegate(ref uint) operations)
    {
        return opApplyImpl(operations);
    }
int opApply(scope int delegate(ref uint) @nogc operations) @nogc
    {
        return opApplyImpl(operations);
    }
    int opApplyImpl(O)(O operations)
    {
        /* ... implementation here ... */
    }

Ah... that's nice...
Thanks!

Reply via email to