HaloO,

Matthew Walton wrote:
If a user of your API contrives to make it change while you're
running, that's their own foot they've just shot, because they can
look at the signature and know the semantics of the parameter passing
being used and know that if they change the value externally before
you return Bad Things Could Happen.

I agree that the caller is responsible for the constness of the value
he gives to a function. With this we get the best performance. I don't
understand why John thinks that an intermediate proxy is needed. A very
shallow wrapper that ensures the readonlyness suffices. Most of the
time not even that when the constness is known statically.


Regards TSa.
--

"The unavoidable price of reliability is simplicity" -- C.A.R. Hoare
"Simplicity does not precede complexity, but follows it." -- A.J. Perlis
1 + 2 + 3 + 4 + ... = -1/12  -- Srinivasa Ramanujan

Reply via email to