On 9/17/17 5:37 PM, David Zhang wrote:
Nevermind! I rediscovered the `inout`attribute.

Correct, inout applied to the function is actually applying to the 'this' parameter. Same as const or immutable functions as well.


Though if I may say so, I have no idea how `inout` is supposed to indicate "whatever the constness of a".


What inout does is look at the mutability of the parameter and transfer it to the mutability of the return type.

-Steve

Reply via email to