News for hackers. Stuff that matters.
Re:The Time Needed to Write “Effective Modern C++” by lultimouomo on Thursday April 23, 2015 @05:51AM (#9425680)
This does not seem like a strong argument. Yes, table salt is useful, but if you don't know what it actually does and you put it in your eyes, it will burn them, just like most, well, everything...

A const reference guarantees to the caller that the callee won't modify the object, not to the callee that the object won't be modified.

Re:The Time Needed to Write “Effective Modern C++” by coliveira on Thursday April 23, 2015 @09:24AM (#9426463)
Except that it doesn't. Thanks to const_cast, you can take away constness from pointers, so where does your "guarantee" comes from?
Re:The Time Needed to Write “Effective Modern C++” by netheril96 on Thursday April 23, 2015 @10:32AM (#9426918)
The guarantee is not against a malicious agent, but a reasonable programmer who may make mistakes.
Re:The Time Needed to Write “Effective Modern C++” by detrino on Thursday April 23, 2015 @06:15PM (#9430240)
A function may not reliably cast a pointer-to-const-T to a pointer-to-T because T may actually be immutable, in which case modifying it would be UB. Like all casts, const_cast exists as an escape hatch in the type system for when you know that what you are doing is safe, even if the compiler can't prove it.