, , smth static (, <). , static .
, , , , - :
class A {
private:
static std::map....
public:
void doSomethingWithMap() {
}
}
If this happens, you might want your mutex to be a member of this class. This is the point - it depends on the volume that you need. If you need to lock globally on all objects of this class, you should consider using a static member of the class, if you want to have a lock for each object - you should set only a member of the class.
source
share