blob: 930b90e2893d2f066984d260f03af8b8089b7d75 [file] [log] [blame]
Patrick Williams864cc432023-02-09 14:54:44 -06001From 5d879cb4f23c613e16b3f479ab09bbb5ff340201 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 6 Feb 2023 17:02:41 -0800
4Subject: [PATCH] Replace std::bind2nd with generic lambda
5
6std::bind2nd is gone in c++17, therefore stop using it and replace it
7with generic lambda from c++14 onwards
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 libutil++/growable_vector.h | 6 +++---
13 1 file changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/libutil++/growable_vector.h b/libutil++/growable_vector.h
16index 350246a..9846e1e 100644
17--- a/libutil++/growable_vector.h
18+++ b/libutil++/growable_vector.h
19@@ -93,9 +93,9 @@ public:
20
21 /// return true if all elements have the default constructed value
22 bool zero() const {
23- return std::find_if(container.begin(), container.end(),
24- std::bind2nd(std::not_equal_to<T>(), T()))
25- == container.end();
26+ return std::find_if(begin(container), end(container),
27+ [&](auto const& elem) {return elem != T();})
28+ == end(container);
29 }
30
31 private:
32--
332.39.1
34