I want put the definition of a view in a separate compilation unit, but to export the view I need it's type.
// .h
auto GetView(int index, int size);
// .cpp
auto GetView(int index, int size)
{
auto view = ranges::views::ints(-2, 3)
| ranges::views::transform([=](auto i)
{
return i + index;
}
)
| ranges::views::enumerate
| ranges::views::filter([=](auto i)
{
return i.second >= 0 && i.second < size;
}
)
;
}
I'm going to answer this one myself but maybe someone can make some helpful comments.