How do I write a range pipeline that uses temporary containers?

It looks like there are now test cases in the range-v3 library that show how to do this correctly. It is necessary to add the views::cache1 operator into the pipeline: auto rng = views::iota(0,4) | views::transform([](int i) {return std::string(i, char(‘a’+i));}) | views::cache1 | views::join(‘-‘); check_equal(rng, {‘-‘,’b’,’-‘,’c’,’c’,’-‘,’d’,’d’,’d’}); CPP_assert(input_range<decltype(rng)>); CPP_assert(!range<const decltype(rng)>); CPP_assert(!forward_range<decltype(rng)>); CPP_assert(!common_range<decltype(rng)>); so the solutions for … Read more