From 1f8a54a33405bfe3c833a4ed69d96b3a68595a01 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 9 Oct 2022 23:15:20 +0000 Subject: [PATCH] Define cstring_tie::end() std::ranges::range requires that T provide a reasonable `end()`. cstring_tie did not provide one since it uses private inheritance of `std::array`. However, it can provide a reasonable one, so define that here. --- common/include/varutil.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/include/varutil.h b/common/include/varutil.h index 3f5691692..f1e4fa520 100644 --- a/common/include/varutil.h +++ b/common/include/varutil.h @@ -25,6 +25,10 @@ public: unsigned count() const { return m_count; } const char *string(std::size_t i) const { return this->operator[](i); } using array_t::begin; + auto end() const + { + return std::next(begin(), m_count); + } private: unsigned m_count; };