3 ms·
> Yes but they could have provided both a single-container-parameter version and a two-iterator-parameter version of all those functions like sort and transform
by MaulingMonkey 8y ago
> Yes but they could have provided both a single-container-parameter version and a two-iterator-parameter version of all those functions like sort and transform.
For my own libraries I'd skip the iterator accepting version. Implementing one range type is way easier / less prone to oversights and other mistakes than double implementing every algorithm. Or more than double implementing, if you need perfect forwarding for non-copyable functors without std::forward pre-C++11. Even though all they do is forward.
SC++L doesn't get much choice since they started with iterators only, but even there, I'm not sure how much time skipping std::range saves you. You can't even take a plain C style array without either a range type, free-form std::begin/std::end, or the iterator variant.
- deleted 8y ago[deleted]