[webkit-dev] On returning mutable pointers from const methods

Filip Pizlo fpizlo at apple.com
Sun Oct 28 15:12:09 PDT 2012


The point is that a rule mandating const methods to return const pointers prevents me from saying that getting a pointer from a container doesn't change the container. 

Hence with any such rule in place you risk there being fewer uses of const.

-Filip

Dnia 28 paź 2012 o godz. 14:40 Peter Kasting <pkasting at chromium.org> napisał(a):

> On Sun, Oct 28, 2012 at 2:29 PM, Filip Pizlo <fpizlo at apple.com> wrote:
>> It is useful to say that "getting a pointer to T from an object of type S does not change S's state".
> 
> That's pretty much the definition of physical constness.
> 
> PK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121028/b2ca14b2/attachment.html>


More information about the webkit-dev mailing list