From ade2ae644d8fc3d9f2b7f446ef34f29c036f792a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Gl=C3=A4ser?= Date: Wed, 28 Jan 2026 10:27:57 +0100 Subject: [PATCH] fix(ranges): cast to size_t to avoid incompatibiliy in writers --- gridformat/common/ranges.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gridformat/common/ranges.hpp b/gridformat/common/ranges.hpp index 584221123..742d5c638 100644 --- a/gridformat/common/ranges.hpp +++ b/gridformat/common/ranges.hpp @@ -32,8 +32,8 @@ namespace GridFormat::Ranges { */ template requires(!Concepts::StaticallySizedRange) -inline constexpr auto size(R&& r) { - return std::ranges::size(r); +inline constexpr std::size_t size(R&& r) { + return static_cast(std::ranges::size(r)); } /*! @@ -44,8 +44,8 @@ inline constexpr auto size(R&& r) { template requires(!std::ranges::sized_range and !Concepts::StaticallySizedRange) -inline constexpr auto size(R&& r) { - return std::ranges::distance(r); +inline constexpr std::size_t size(R&& r) { + return static_cast(std::ranges::distance(r)); } /*! @@ -53,8 +53,8 @@ inline constexpr auto size(R&& r) { * \brief Return the size of a range with size known at compile time. */ template -inline constexpr auto size(R&&) { - return static_size; +inline constexpr std::size_t size(R&&) { + return static_cast(static_size); } /*!