Question

std::sort(range(c));

as opposed to

std::sort(c.begin(), c.end();

Do you expect the next standard to provide range overloads for standard algorithms?

Boost's range iterators are something similar, and Bjarne Stroustrup's iseq()s mentioned in TC++PL3e are also the same idea. I have looked at the latest draft I could find but didn't see range overloads mentioned.

Was it helpful?

Solution

The History page provides a partial answer.

There has to be a compelling need to add overloads to the std namespace. Note, this is a Library Issue. You can search the archives to find if anyone has previously raised a request to add these to the library. If there isn't any you can submit a defect report. The current language does not, in any way, stop you from writing your own wrappers. So, the question boils down to whether a lot of others will also want this as a standard library supported feature or not. But that ain't all. Any extension, even to the library, is not just a technical choice, but is also guided by numerous other geo-political issues. You have to have a certain number of votes to get this in.

Frankly, I'd love to see this get in. However, remember this in no way is a novel/core feature that the library can't do without. So, keep your fingers crossed.

OTHER TIPS

The range-based for loop is the only thing in the draft standard I could find that uses the Range concept. It seems natural to me that most of the standard algorithms could support Ranges, but there's no mention of it in the draft standard you linked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top