Are there any standard/de facto standard (boost) wrappers around standard algorithms which work with containers defining begin and end. Let me show you what I mean with the code:
// instead of specifying begin and end
std::copy(vector.begin(), vector.end(), output);
// write as
xxx::copy(vector, output);
I know it can be written easily, but I am looking specifically for something ubiquitous. Thanks.
There is an extension to the Boost Range library called RangeEx which contains range wrappers for all stl algorithms, plus some new ones.
It has recently been accepted into Boost and so it's not yet in the current "official" release (1.41). Until this changes, you can download the latest version from the Boost Vault.
Don't know if this will ever become part of the C++ standard, but the fact that it's in Boost means that it will be the de facto standard.
The next standard will (hopefully!) amend this. In the meantime, take a look at Boost.Range and its various uses although I’m not aware of an interface to the standard algorithms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With