On Sat, 15 Feb 2014 23:35:52 -0500, Meta <jared...@gmail.com> wrote:
On Sunday, 16 February 2014 at 03:26:42 UTC, Steven Schveighoffer wrote:
I'm not sure what you are asking, because the answer I want to give is
so trivial :)
Then I don't know what we're arguing about. I'm saying that if you pass
mutable data to an inout function, inout effectively acts as logical
const within that function, as the compiler doesn't allow you to modify
the inout function argument but it is safe to cast away inout. Do you
agree or disagree with this?
It is safe if you can guarantee the input is ultimately mutable. But there
is no way to enforce such a guarantee. It is on the caller to make sure
that is true.
I don't see why inout should be identified as any different from const in
this respect. You could just as easily say the same thing about const.
-Steve