If I have a function
std::array<unsigned,2> fib(std::array<unsigned,2> p)
{
return {p[1],p[1]+p[0]};
}
I'd like to have a way to elegantly generate the infinite range
[x,fib(x),fib(fib(x)),fib(fib(fib(x))),...]
This comes up frequently enough that I need to find what's the best way to do this?