Is there a `shared_lock_guard` and if not, what would it look like?
问题 I wanted to use a std::mutex in my class, and noticed that it isn't copyable. I'm at the bottom level of my library here, so it seems like a terrible idea to have this behaviour. I used std::lock_guard on the std::mutex , but there doesn't seem to be a shared_lock_guard , which would be preferable to provide write-locks-exclusively behaviour. Is this an oversight or trivial to implement myself? 回答1: With C++14 You can use a std::shared_lock and a std::unique_lock to implement read/write