We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9468913 commit 6b0b722Copy full SHA for 6b0b722
src/util/range.h
@@ -341,6 +341,20 @@ struct ranget final
341
return begin_value == end_value;
342
}
343
344
+ /// Drop the first \p count elements.
345
+ /// If the range has fewer elements, drops everything.
346
+ /// \return true if the range still contains element after the drop
347
+ bool drop(std::size_t count)
348
+ {
349
+ for(std::size_t i = 0; i < count; ++i)
350
351
+ if(begin_value == end_value)
352
+ return false;
353
+ ++begin_value;
354
+ }
355
+ return begin_value != end_value;
356
357
+
358
iteratort begin() const
359
{
360
return begin_value;
0 commit comments