GuiLock is defined as a struct, and GuiUnlock as a class. I think the source code should be consistent.
My recommendation:
class GuiLock { // <--- changed struct to class
public: // <--- added.
GuiLock() { EnterGuiMutex(); }
~GuiLock() { LeaveGuiMutex(); }
};
class GuiUnlock {
int n;
public:
GuiUnlock() { n = LeaveGuiMutexAll(); }
~GuiUnlock() { EnterGuiMutex(n); }
};
Best regards,
Oblivion
IDK. I am using struct in almost all cases where either all members are naturally public or I do not care about hiding by private (which is 99% of time in end applications). Is that wrong? For me the difference between struct and class is the default access, nothing else...