aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-06-12 15:52:06 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-06-12 15:52:06 +0100
commitce657a74143a11bfa43f5d334b11b57954568f12 (patch)
treef660d0a42132404c174a91c425ef487a20bc32d6
parentcd0b94e650a880b2ab04922e476aa28007277d5c (diff)
downloadgcc-ce657a74143a11bfa43f5d334b11b57954568f12.zip
gcc-ce657a74143a11bfa43f5d334b11b57954568f12.tar.gz
gcc-ce657a74143a11bfa43f5d334b11b57954568f12.tar.bz2
Simplify std::scoped_lock destructor
* include/std/mutex (scoped_lock::~scoped_lock()): Use fold expression. From-SVN: r272187
-rw-r--r--libstdc++-v3/ChangeLog3
-rw-r--r--libstdc++-v3/include/std/mutex6
2 files changed, 4 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 6d5e4b9..008a709 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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))
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index ca2c669..981b672 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;