On Saturday, 24 September 2016 at 10:16:34 UTC, Basile B. wrote:
You don't need to cast, from "mutable" to "const" is implicit:
https://dlang.org/spec/const3.html#implicit_conversions

Ok, but using const would be an accepted way of doing this? The options I could see were to have "_o" as a const or immutable type and just create a const on the first call to the lazily evaluated property, or to do what I did and have "_o" as a non-const and then convert it to cost on the way out. However

To store it as const I guess I'd have to make it a non-const pointer to a const object, and is that not kind of what immutable is?


Reply via email to