A class with non-copyable member is said to be also non-copyable. From SO, to make a class non-copyable these are the options:
- Use boost::noncopyable
-
Declare constructor and assignment operator as private.
class foo { private: std::mutex _dummy; };
Question: Will inclusion of a dummy non-copyable member be used for similar purpose and for simplicity? What are the down-sides?
Aucun commentaire:
Enregistrer un commentaire