[webkit-dev] Using C++ constant local variables in WebKit

Ojan Vafai ojan at chromium.org
Wed Nov 30 18:26:16 PST 2011


On Wed, Nov 30, 2011 at 5:12 PM, Alexey Proskuryakov <ap at webkit.org> wrote:

>
> 30.11.2011, в 17:00, David Kilzer написал(а):
>
> -                char* bufferStart = bufferPos;
> +                char* const bufferStart = bufferPos;
>
>
> FWIW, working with code that parses strings is when I also always find
> myself eager to use const local variables (pointers or indices).
>

I don't mind using const in some cases, but I share Darin's concern of
littering the code with consts. I'd prefer that we come up with a fairly
conservative guideline about when to use it. I'm not sure what that would
look like. We could start with, what's special about this case, or string
parsing in general that makes using const more valuable?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20111130/110c9cbb/attachment.html>


More information about the webkit-dev mailing list