]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don’t capture “this” implicitly
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Jan 2021 14:33:24 +0000 (15:33 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Jan 2021 14:33:24 +0000 (15:33 +0100)
This avoids an “implicit capture of 'this' via '[=]' is deprecated”
warning when building for C++20 and does no harm for earlier versions.

src/Hash.cpp

index ccc6f7bb31a7cf665ddd42a0987aafc38fa5986e..61cc5a3e734b3fc59bcbb66b689d8e8144b211e5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2020 Joel Rosdahl and other contributors
+// Copyright (C) 2020-2021 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -106,7 +106,7 @@ bool
 Hash::hash_fd(int fd)
 {
   return Util::read_fd(
-    fd, [=](const void* data, size_t size) { hash(data, size); });
+    fd, [this](const void* data, size_t size) { hash(data, size); });
 }
 
 bool