So what does (inout int = 0) do?
w0rp via Digitalmars-d
digitalmars-d at puremagic.com
Fri Apr 15 00:33:42 PDT 2016
I think it has something to do with making the function, in this
case a lambda, inout, so that it can accept inout types. Then the
typeof bit is a weird way to writing something like
__traits(compiles, ...) , because functions which have no type
result in void, and that fails the typeof check.
If we do end up replacing inout with something else, I would like
something which solves the problem of declaring functions
returning ranges of either mutable, const, or immutable. I've
struggled with that before:
https://github.com/w0rp/dstruct/blob/master/source/dstruct/graph.d#L628
More information about the Digitalmars-d
mailing list