Skip to content

Commit

Permalink
Fix repeat_n
Browse files Browse the repository at this point in the history
  • Loading branch information
TartanLlama committed Dec 9, 2024
1 parent 8d3d0ad commit 0378f58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/tl/repeat_n.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand All @@ -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 {
Expand Down

0 comments on commit 0378f58

Please sign in to comment.