From e7d4860d75b3ac6473237fe62ece5db6204c378b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Fri, 12 Jul 2024 12:43:33 +0200
Subject: [PATCH] Do not use C++20 input range adaptors

Not supported by LLVM/libc++ < 16.
---
 src/macro/Environment.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/macro/Environment.cc b/src/macro/Environment.cc
index 46519e6c..dad11ff6 100644
--- a/src/macro/Environment.cc
+++ b/src/macro/Environment.cc
@@ -118,7 +118,8 @@ Environment::print(ostream& output, const vector<string>& vars, int line, bool s
   if (vars.empty())
     {
       vector<string> variables_sorted;
-      ranges::copy(views::keys(variables), back_inserter(variables_sorted));
+      ranges::transform(variables, back_inserter(variables_sorted),
+                        &decltype(variables)::value_type::first);
       ranges::sort(variables_sorted, case_insensitive_string_less);
       for (const auto& it : variables_sorted)
         printVariable(output, it, line, save);
@@ -134,7 +135,8 @@ Environment::print(ostream& output, const vector<string>& vars, int line, bool s
   if (vars.empty())
     {
       vector<string> functions_sorted;
-      ranges::copy(views::keys(functions), back_inserter(functions_sorted));
+      ranges::transform(functions, back_inserter(functions_sorted),
+                        &decltype(functions)::value_type::first);
       ranges::sort(functions_sorted, case_insensitive_string_less);
       for (const auto& it : functions_sorted)
         printFunction(output, it, line, save);
-- 
GitLab