From 0378f584292ddaf9462804fa5263fc97308cd8a6 Mon Sep 17 00:00:00 2001 From: Sy Brand Date: Mon, 9 Dec 2024 09:57:39 +0000 Subject: [PATCH] Fix repeat_n --- include/tl/repeat_n.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tl/repeat_n.hpp b/include/tl/repeat_n.hpp index 81d137a..79dd70e 100644 --- a/include/tl/repeat_n.hpp +++ b/include/tl/repeat_n.hpp @@ -19,14 +19,14 @@ namespace tl { class cursor { T const* value_; - std::size_t pos_ = 0; + std::ptrdiff_t pos_ = 0; public: static constexpr bool single_pass = false; cursor() = default; constexpr explicit cursor(T const* value, std::size_t pos) - : value_{ value }, pos_{ pos } {} + : value_{ value }, pos_( pos ){} constexpr decltype(auto) read() const { return *value_; @@ -52,7 +52,7 @@ namespace tl { } constexpr auto distance_to(const cursor& rhs) const { - return rhs.pos_ - pos_; + return rhs.pos_ - pos_; } constexpr auto distance_to(std::default_sentinel_t rhs) const {