why can't I call const methods on shared objects?
FreeSlave via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun May 11 00:31:09 PDT 2014
On Friday, 9 May 2014 at 21:42:14 UTC, Vlad Levenfeld wrote:
> Is this still the case if the method is const or pure?
Const methods still require synchronization, because other
threads may change some data, needed by const method while method
is executed, and then you may get wrong results.
Consider:
class Point
{
public:
float x;
float y;
}
More information about the Digitalmars-d-learn
mailing list