This came up in https://bugs.webkit.org/show_bug.cgi?id=59604.

My personal preference is against const member functions because they force 
many error-prone code changes: introducing a const forces the transitive 
closure of all potential callees to change their signatures recursively, and if 
you get this wrong in the case of a virtual function, you introduce a very 
subtle set of bugs.

I don't see much upside to const member functions because they're just an 
unenforced convention: sub-object and "mutable" data members are still 
non-const inside a so-called const function, and you can always const_cast away 
so-called const-ness, as WebKit currently does in 483 places.

Geoff
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to