On Wednesday, 4 December 2019 at 22:51:01 UTC, Ola Fosheim Grøstad wrote:
Is there a way to specify in generic code that you want the best fit of a const/immutable reference depending on the return type (but not a mutable one)?

I mean, if f() return mutable or const then it should be const, but if it returns immutable then it should be immutable. Something like:

readonly myref = f()


Reply via email to