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

Jonathan M Davis jmdavisProg at gmx.com
Tue Jun 28 15:40:45 PDT 2011


On 2011-06-28 15:02, Simen Kjaeraas wrote:
> 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.

Except that they're thread-local if not shared, aren't they?

- Jonathan M Davis


More information about the phobos mailing list