Simplify std::scoped_lock destructor

* include/std/mutex (scoped_lock::~scoped_lock()): Use fold
	expression.

From-SVN: r272187
This commit is contained in:
Jonathan Wakely 2019-06-12 15:52:06 +01:00 committed by Jonathan Wakely
parent cd0b94e650
commit ce657a7414
2 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,8 @@
2019-06-12 Jonathan Wakely <jwakely@redhat.com>
* include/std/mutex (scoped_lock::~scoped_lock()): Use fold
expression.
* include/Makefile.am: Add new <bits/charconv.h> header.
* include/Makefile.in: Regenerate.
* include/bits/basic_string.h (to_string(int), to_string(unsigned))

View File

@ -576,11 +576,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ } // calling thread owns mutex
~scoped_lock()
{
std::apply([](_MutexTypes&... __m) {
char __i[] __attribute__((__unused__)) = { (__m.unlock(), 0)... };
}, _M_devices);
}
{ std::apply([](auto&... __m) { (__m.unlock(), ...); }, _M_devices); }
scoped_lock(const scoped_lock&) = delete;
scoped_lock& operator=(const scoped_lock&) = delete;