repeat
template<typename T>
impl-dfn-deferred-range repeat(T value, int count);
Creates a deferred-range of repeated elements.
Parameters
- value - the value which is to be repeated.
- count - the number of times value is to be repeated in the generated range.
Return
A deferred-range.
Example
#include <iostream>
#include <vector>
#include <foam/composition/pipeline.h>
int main()
{
using namespace foam::composition;
auto numbers = repeat(10, 5);
for(int i : numbers)
std::cout << i << " ";
}
Output
10 10 10 10 10
Other pipes
- accumulate
- arithmetic_sequence
- filter
- from
- generate
- geometric_sequence
- order_by
- prime_range
- prime_sequence
- range
- skip
- skip_while
- sort
- sum
- take
- take_while
- transform