[phobos] [D-Programming-Language/phobos] 4f28db: not really pure

Simen Kjaeraas simen.kjaras at gmail.com
Tue Jun 28 15:02:23 PDT 2011


On Tue, 28 Jun 2011 21:39:49 +0200, Jonathan M Davis <jmdavisProg at gmx.com>  
wrote:
> Ideally, under at least some circumstances, const member functions would  
> be
> considered strongly pure given that it's known that the object that  
> they're
> called on isn't altered within the expression. I don't know how well  
> that that
> would actually work though. Certainly, the rules on weak purity would  
> have to
> be relaxed a bit based on how the functions are called (which Steve was
> talking about), so I wouldn't expect it to be happening at this point
> regardless. But ideally it would.

I don't believe they could, no. Some other thread might change the object
while it's inside the member function.

-- 
   Simen


More information about the phobos mailing list