It turns out it's quite hard to have @safe pure nothrow functions. Oh, and const.

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 14 01:47:08 PDT 2014


On Saturday, 13 September 2014 at 23:41:55 UTC, Timon Gehr wrote:
> All the examples there keep their non-modification guarantees.
> Modifications to inout parameters are visible at the call site.

Modifications are visible if you know the inout argument will be 
passed to the delegate, i.e. if you know the callee's 
implementation, and can't reason about behavior of inout argument 
just by seeing it being inout.

> E.g. the inout qualifier of the enclosing function should still 
> be fully compatible with _itself_ even when data is accessed 
> and modified from the nested function.

Yeah, I think, it's logical if the nested function is just a 
fragment of enclosing function; that way nested functions can be 
created without hindering access to variables of enclosing 
function.


More information about the Digitalmars-d mailing list