Since the ranges-library is up for inclusion into the standard I was toying around with it for a while and I have some problems with very basic concepts.
The toy example I am struggling with is this:
#include <iostream>
#include <range/v3/all.hpp>
using namespace ranges;
int main (int argc, char const* argv[]) {
auto v = view::iota(1, 10);
std::default_random_engine gen;
auto t = action::push_back(view::iota(0, 10)) | action::shuffle(gen);
std::cout << t << "\n";
}
The fact that it is not printable kind of suggests to me that t is not really a proper range. Unfortunately the documentation (where there is any) really abuses auto, so I do not know what is going on. What do I have to do, why do I have to do it (and in case anyone does know: how is the result type going to be documented (imo proxy objects and auto don't mix well - see the Eigen library as an example)).
My second question is related to the cargo-culted action::push_back. If I omit it I get a concept error telling me that the iota-generated view needs to be mutable. Obviously a view is by design immutable, so I get the problem here, but is "pushing nothing" really the preferred way to lift things into a mutable/stateful object or are there alternatives?
Best, Richard