From: Jonathan Wakely Date: Wed, 12 Jun 2019 14:52:06 +0000 (+0100) Subject: Simplify std::scoped_lock destructor X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce657a74143a11bfa43f5d334b11b57954568f12;p=gcc.git Simplify std::scoped_lock destructor * include/std/mutex (scoped_lock::~scoped_lock()): Use fold expression. From-SVN: r272187 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6d5e4b9ec16..008a709ce2d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-06-12 Jonathan Wakely + * include/std/mutex (scoped_lock::~scoped_lock()): Use fold + expression. + * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/bits/basic_string.h (to_string(int), to_string(unsigned)) diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index ca2c669db9a..981b6725f7c 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -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;