From 876e9bd357cb51293f3a03cc558c3a25783f8cde Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 6 Sep 2026 12:02:07 +0200 Subject: [PATCH] refactor: include what these two files use, and reverse by range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `random.cpp` calls `std::back_inserter` and `odf_table_test.cpp` calls `std::ranges::find`, and neither includes the header that declares it. Both compile today only because libc++ hands them out through `` and `` — which it stops doing under C++23, so this is the whole source cost of that bump, extracted. `type1_charstring`'s `std::reverse(args.begin(), args.end())` becomes `std::ranges::reverse(args)` per the ranges convention. C++20, unrelated to the above; it is here because it is the same size. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01QoTh7BEUSL2z9BBThgsEi7 --- src/odr/internal/common/random.cpp | 1 + src/odr/internal/font/type1_charstring.cpp | 2 +- test/src/internal/odf/odf_table_test.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/odr/internal/common/random.cpp b/src/odr/internal/common/random.cpp index d3f4c8286..bfb320699 100644 --- a/src/odr/internal/common/random.cpp +++ b/src/odr/internal/common/random.cpp @@ -1,6 +1,7 @@ #include #include +#include #include namespace odr { diff --git a/src/odr/internal/font/type1_charstring.cpp b/src/odr/internal/font/type1_charstring.cpp index e957fb582..43ae69b78 100644 --- a/src/odr/internal/font/type1_charstring.cpp +++ b/src/odr/internal/font/type1_charstring.cpp @@ -321,7 +321,7 @@ class Translator { m_stack.pop_back(); } // args is reversed (top first); restore call order. - std::reverse(args.begin(), args.end()); + std::ranges::reverse(args); switch (othersubr) { case 1: // flex start diff --git a/test/src/internal/odf/odf_table_test.cpp b/test/src/internal/odf/odf_table_test.cpp index a800be7e5..ad43edc51 100644 --- a/test/src/internal/odf/odf_table_test.cpp +++ b/test/src/internal/odf/odf_table_test.cpp @@ -14,6 +14,7 @@ #include +#include #include #include #include