[webkit-dev] Do we have a style preference about const member functions?

Maciej Stachowiak mjs at apple.com
Tue Jun 7 23:18:26 PDT 2011


On Jun 7, 2011, at 4:22 PM, Darin Adler wrote:

> I think the “make some things non-const” part of this would be the first part to put up for review and land.

To expand on Darin's remark in two different ways:

1) We definitely have consensus to fix the broken non-logically-const accessors by making them non-const; consensus on also adding const accessors is less clear.
2) We like to do things incrementally and fixing bad use of const before adding good use of const seems like this is a logical way to split the work and make it less of a megapatch.

(As a separate technical comment, I think it may be better to have the const versions call non-const versions (casting away const on "this"), because the non-const versions are likely to be called much more often so it's helpful to have fewer levels of indirection to wade through before seeing the real code, e.g. when inspecting code or debugging.)

Regards,
Maciej



More information about the webkit-dev mailing list