On 11/11/2016 01:30 AM, Kinkie wrote: > On Fri, Nov 11, 2016 at 5:02 AM, Amos Jeffries <squ...@treenet.co.nz> wrote: >> On 11/11/2016 9:28 a.m., Kinkie wrote: >>> >>> v4 attached. >>> >> >> Does it have to take begin() and end() iterators explicitly? >> can we not have it take the container itself and use a for(auto &i : >> container) loop ? > > No it doesn't but it's sometimes convenient. > My use case is the regex-compressing code. It can be reduced to (pseudocode) > > join(regex-so-far, wordsList., separator=")|(", prefix="(", suffix=")") > > granted, it can be done with explicit append calls but then you can't > inline it (e.g in streams). > > The code used to take the whole container, but there's a use case for > iterating over a slice only.
Accepting iterators is standard in STL (despite being slightly inconvenient) probably because accepting iterators covers a lot more potential use cases. Alex. _______________________________________________ squid-dev mailing list squid-dev@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-dev