Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions gridformat/common/ranges.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace GridFormat::Ranges {
*/
template<std::ranges::sized_range R>
requires(!Concepts::StaticallySizedRange<R>)
inline constexpr auto size(R&& r) {
return std::ranges::size(r);
inline constexpr std::size_t size(R&& r) {
return static_cast<std::size_t>(std::ranges::size(r));
}

/*!
Expand All @@ -44,17 +44,17 @@ inline constexpr auto size(R&& r) {
template<std::ranges::range R>
requires(!std::ranges::sized_range<R> and
!Concepts::StaticallySizedRange<R>)
inline constexpr auto size(R&& r) {
return std::ranges::distance(r);
inline constexpr std::size_t size(R&& r) {
return static_cast<std::size_t>(std::ranges::distance(r));
}

/*!
* \ingroup Common
* \brief Return the size of a range with size known at compile time.
*/
template<Concepts::StaticallySizedRange R>
inline constexpr auto size(R&&) {
return static_size<R>;
inline constexpr std::size_t size(R&&) {
return static_cast<std::size_t>(static_size<R>);
}

/*!
Expand Down