Skip to content

Commit 48a313f

Browse files
Add a skip method for ranget
1 parent fbf514c commit 48a313f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/util/range.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,16 @@ struct ranget final
353353
}
354354
}
355355

356+
/// Return an new range containing the same elements except for the first
357+
/// \p count elements.
358+
/// If the range has fewer elements, returns an empty range.
359+
ranget<iteratort> skip(std::size_t count) const
360+
{
361+
ranget<iteratort> skip_range{begin(), end()};
362+
skip_range.drop(count);
363+
return skip_range;
364+
}
365+
356366
iteratort begin() const
357367
{
358368
return begin_value;

0 commit comments

Comments
 (0)