mercredi 31 octobre 2018

Set of mutex pointers

I am trying to store several mutex (pointers) into a set.

std::set<std::mutex*> mutex_set;    

addLock(const std::mutex* lock)
{
  mutex_set.insert(lock)
}

Since that is not working I tried lock guards and unique pointers, but did not have any success. What is the best way to store mutex into a set?

Aucun commentaire:

Enregistrer un commentaire