Closed tcbrindle closed 1 year ago
Patch coverage: 100.00
% and project coverage change: +0.04
:tada:
Comparison is base (
51cda50
) 97.79% compared to head (b822393
) 97.83%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This has two overloads:
repeat(obj)
endlessly yields a const reference toobj
repeat(obj, n)
yields a const reference toobj
exactlyn
timesThe first works like
single(obj).cycle()
, and the second works likesingle(obj).cycle(n)
. Orrepeat(obj).take(n)
. Orsingle(obj).cycle().take(n)
...Both overloads are always random-access, and the finite version is additionally sized and bounded.
Like
cycle()
, the infinite version ofrepeat()
can theoretically rollover the size_t counter for very long-running processes (very very very long-running on 64-bit systems). This won't cause UB, butdistance()
might give incorrect results, or raise a runtime error if the counter exceeds the maximum representable value of adistance_t