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
Nevermind! I rediscovered the `inout`attribute.
Though if I may say so, I have no idea how `inout` is supposed to
indicate "whatever the constness of a".
On Sunday, 17 September 2017 at 21:18:08 UTC, David Zhang wrote:
Hi,
I have a class `Image`, and I have a function called
`getSubImage(Rect bounds)`. What I can't figure out is how to
get the result of `getSubImage()` to take on the constness of
the backing image.
ie.
//The Image
Hi,
I have a class `Image`, and I have a function called
`getSubImage(Rect bounds)`. What I can't figure out is how to get
the result of `getSubImage()` to take on the constness of the
backing image.
ie.
//The Image class is really just a view over a buffer that's
managed elsewhere