I have the following class that has the private member - QMutex - m_mutex_A;
class A
{
public:
QMutex get_handle();
private:
QMutex m_mutex_A;
}
QMutex A::get_handle()
{
return m_mutex_A;
}
However, on building this snippet, I get the problem saying that the error: 'QMutex::QMutex(const QMutex&)' is private
On google, I found that one of the way is to make QMutex m_mutex_A; as mutable QMutex m_mutex_A; However, this doesn't work. Another strange part is that when I move this m_mutex_A to public then there is no problem. Also, the code works. What is the issue here? Can you please throw some light on it? I guess, I am missing some fundamentals here.