opApply @safety

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 29 11:00:08 PST 2016


On 1/29/16 12:44 PM, Chris Wright wrote:
> I want to create an opApply for a type.
>
> I've marked my code @safe, because everything I wrote was @safe. The body
> of opApply is @safe, but it calls a delegate that may or may not be @safe.
>
> How do I make it so I can iterate through this type safely and systemly?

Likely an overload. Tag the delegate as being @safe or not.

-Steve


More information about the Digitalmars-d-learn mailing list