The practical reason for overloading containers or ranges has not yet been completed is related to the proposal of concepts.
Algorithms now take a bunch of template parameters and set requirements on them. If you pass types that do not meet the requirements, they may not compile or may just not work properly.
Overloads almost always simply include a different number of parameters.
If we add container / range overloading, we need to either give them new names (ick) or modify existing algorithms to be overloaded. Overloading (iterator, iterator, value) and overloading (range, value, function) have the same number of arguments, and one of them can easily confuse the compiler (and unexpected results may occur).
While we could go and specify overload restrictions for all existing algorithms one by one, and then add overloads for ranges, at the moment the code and requirements will be ugly. After adding concepts to the language, we hopefully will have a set of brief concepts that describe what parameters should be, and a language function that makes the implementation easy and clean.
It may turn out that these algorithms may not be practically overloads of existing algorithms due to compatibility reasons or what you have, but even this will be easier to work with.
Initially, iterators were enough, and they separated the containers from the algorithms. Then ranges could be added, but the language mechanism for interpreting containers with a clean range was somewhat lacking (for example, the decltype type), and this was not strictly required. Since then, support for the range has been desirable, but not easy to do, and there is (on the horizon) an extension of the language that will make it much cleaner and easier.
Yakk Aug 19 '15 at 14:20 2015-08-19 14:20
source share