Open thehans opened 4 years ago
Note that I don't think there's an all_view
in ranges-v3, but there is all_t
. The standard will follow suit given http://wg21.link/LWG3335.
views::all
is used to make an initial, viewable_range
that's not a view
into a view
. For example, given std::vector<int> x{1, 2, 3};
, views::take(x, 3)
will pass x
through views::all(x)
to make into a view
. In this case, it is not a noop
.
OK, I had been looking at the docs from cppreference descriptions, which I guess are (understandably) not necessarily consistent with the most recent drafts?
I've just started reading up and trying to learn about ranges, and I guess I'm confused about what makes a view a factory vs an adaptor.
My basic understanding is that adaptors can be composed from other ranges via pipe operator.
Whereas factories act more like the beginning or initial input to such a composition, and don't need input from another range.
So to me, it seems like
all_view
makes sense as a range factory which creates a range from a container, as this example shows:But as an adaptor it seems to be a completely superfluous
noop
?