diff --git a/gridformat/common/ranges.hpp b/gridformat/common/ranges.hpp index 58422112..742d5c63 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); } /*!