Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 1 | From 5d879cb4f23c613e16b3f479ab09bbb5ff340201 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 6 Feb 2023 17:02:41 -0800 |
| 4 | Subject: [PATCH] Replace std::bind2nd with generic lambda |
| 5 | |
| 6 | std::bind2nd is gone in c++17, therefore stop using it and replace it |
| 7 | with generic lambda from c++14 onwards |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | libutil++/growable_vector.h | 6 +++--- |
| 13 | 1 file changed, 3 insertions(+), 3 deletions(-) |
| 14 | |
| 15 | diff --git a/libutil++/growable_vector.h b/libutil++/growable_vector.h |
| 16 | index 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 | -- |
| 33 | 2.39.1 |
| 34 | |