Boost logo

Boost :

Subject: Re: [boost] [Range] sorted and randomized adaptors
From: Jeff Flinn (jeffrey.flinn_at_[hidden])
Date: 2015-11-09 22:14:48

On 10/31/15 7:33 PM, Mohammed El-Afifi wrote:
> Hello everybody,
> I know this might have been raised a few times before in this mailing list,
> but I'd like to know if it's possible(or otherwise what would prevent) to
> have sorted and randomized adaptors so that I may have a sorted and
> randomized view of a range respectively. Something like
> vector<int> x;
> // operations to fill x
> x | boost::adaptors::sorted;
> x | boost::adaptors::randomized;// That one might also take an optional
> random generator as a parameter.
> I understand that in this case the adaptor isn't entirely lazy as the
> adapted(x here) must be completely consumed before producing a single
> element in the resulting range. I want to know however if having such
> adaptors may contradict any basic principles of the existing adaptors.
> P.S. Two other threads I found that discussed the same idea(for sorted only):
> -
> -

Check out for related discussions and his range
v3 library, which provide non lazy adaptors for the above.


Boost list run by bdawes at, gregod at, cpdaniel at, john at