From c9034485cbac45dfb0923ba29c11e617d7ac5151 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 12 Dec 2023 08:03:26 +0100 Subject: Fix compiler warning about std::binary_function being deprecated as of C++11 --- src/CMakeLists.txt | 2 +- src/history.cc | 6 +++++- src/item.cc | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4e0e23de..0d6bc085 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -183,7 +183,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") if (BUILD_LIBRARY) list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) endif() - list(APPEND _args "-std=c++11 ") + list(APPEND _args "-std=c++11") if (CYGWIN) list(APPEND _args "-U__STRICT_ANSI__") endif() diff --git a/src/history.cc b/src/history.cc index dbcdc823..d5eb727c 100644 --- a/src/history.cc +++ b/src/history.cc @@ -39,7 +39,11 @@ #include "history.h" template -struct f_max : public std::binary_function { +struct f_max +#if __cplusplus < 201103L +: public std::binary_function +#endif +{ T operator()(const T& x, const T& y) const { return std::max(x, y); } diff --git a/src/item.cc b/src/item.cc index 30727c1b..df0ce920 100644 --- a/src/item.cc +++ b/src/item.cc @@ -105,7 +105,9 @@ optional item_t::get_tag(const mask_t& tag_mask, namespace { struct CaseInsensitiveKeyCompare +#if __cplusplus < 201103L : public std::binary_function +#endif { bool operator()(const string& s1, const string& s2) const { return boost::algorithm::ilexicographical_compare(s1, s2); -- cgit v1.2.3