blob: ce997f4505e5727c93fc81c2d1813ce1ccf6776b [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From a3d0a0419a35bef9b80a6a12432ab30e2d1e0f5a Mon Sep 17 00:00:00 2001
2From: Tomas Volf <~@wolfsden.cz>
3Date: Tue, 5 Mar 2024 22:27:42 +0100
4Subject: [PATCH] gm_utils.h: Drop std::unary_function.
5
6I am not sure what it does, it is deprecated/removed (depending on C++ version)
7and the advice seems to be that is just is not necessary. So just remove it.
8
9* src/gm_utils.h (print_f, pair_print_f): Drop std::unary_function.
10---
11 src/gm_utils.h | 4 ++--
12 1 file changed, 2 insertions(+), 2 deletions(-)
13
14--- a/src/gm_utils.h
15+++ b/src/gm_utils.h
16@@ -117,7 +117,7 @@ bool string_contains(const char *s, cons
17 * Function object to print something into a stream (to be used with for_each)
18 */
19 template<class T>
20-struct print_f : public std::unary_function<T, void>
21+struct print_f
22 {
23 print_f(std::ostream& out, const string &s = ", ") : os(out), sep(s) {}
24 void operator() (T x) { os << x << sep; }
25@@ -129,7 +129,7 @@ struct print_f : public std::unary_funct
26 * Function object to print a pair into two streams (to be used with for_each)
27 */
28 template<class T>
29-struct pair_print_f : public std::unary_function<T, void>
30+struct pair_print_f
31 {
32 pair_print_f(std::ostream& out1, std::ostream& out2, const string &s = ", ") :
33 os1(out1), os2(out2), sep(s) {}