template<typename T>
impl-dfn-deferred-range prime_range(T start, T end)

Creates a deferred range of prime numbers.

Parameters

  • start - the lower bound of the range to be generated whose first element is start if it is a prime number or the minimum prime number greater than start.

  • end - the upper bound of the range to be generated. It is not included in the range even if it is a prime number.

Return

A deferred-range of prime numbers.

Example

#include <iostream>
#include <vector>
#include <foam/composition/pipeline.h>

int main()
{
    using namespace foam::composition;

    auto primes = prime_range(49, 87);

    for(int i : primes)
        std::cout << i << " ";
}

Output

53 59 61 67 71 73 79 83

Other pipes