Since once_flag is neither moveable nor copyable, what should I do in case I'm using it as a member of a class that I need to be moveable? It seems that the target of the move has no way of initializing its own flag to the same state since one cannot read the state of the once_flag. A workaround using a second flag protected by a mutex inside both the move ctor/assignment and the function call_once() uses defeats the point of using once_flag in the first place.
jeudi 3 août 2017
once_flag member of moveable class
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire