[webkit-dev] Using C++ constant local variables in WebKit
rniwa at webkit.org
Tue Nov 29 18:44:34 PST 2011
On Tue, Nov 29, 2011 at 6:42 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> - Prevents misuse of variable in a later patch (by a different author)
>> through enforcement of const-ness.
>> Prevents one specific type of misuse: Setting the variable to another
>> value. And that may not be misuse despite the fact that the original author
>> didn’t plan on changing it.
> Right, but it tells us the intent of the author, and appears to be useful
> even if the variable started with prefixes like "old", "original", and
I'll add that I'd much prefer seeing a const in front of a local variable
over seeing a comment like "This variable shouldn't be modified".
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev