std::lock_guard or std::scoped_lock?

C++17 introduced a new lock class called std::scoped_lock.

Judging from the documentation it looks similar to the already existing std::lock_guard class.

What’s the difference and when should I use it?

4 Answers
4

Leave a Comment