
20 Oct
2004
20 Oct
'04
8:40 p.m.
Rob Stewart wrote:
What if the class had the option, at least, to hold multiple forms, creating each on demand? Then, the operations you invoke would simply request the particular form they require. If that form is not currently available, it is generated.
The classic problem is that logically const operations are now physically non-const (as I was surprised to learn from Howard Hinnant, this is the case with std::locale.) The implicit thread safety contract ("basic thread safety") says that unless stated otherwise, several logically const operations can be performed concurrently. This would now require a mutex lock.