From ce657a74143a11bfa43f5d334b11b57954568f12 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 12 Jun 2019 15:52:06 +0100 Subject: [PATCH] Simplify std::scoped_lock destructor * include/std/mutex (scoped_lock::~scoped_lock()): Use fold expression. From-SVN: r272187 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/include/std/mutex | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) 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; -- 2.30.2