002-gm_utils.h-Drop-std-unary_function.patch 1.2 KB

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