On Aug 19, 2014, at 11:55 AM, Peter Dimov
Beman Dawes wrote:
The intent was always to submit is_iterator to Boost, but we never got around to it. Now I need it in Boost.Filesystem, so I'd rather see it go in type traits than just sticking it into boost/filesystem/detail.
Out of curiosity, why do you need it?
Fwiw, I used something closely related in libc++ for SFINAE on the “member template members” of the containers (the ones taking iterators) to disambiguate them from the members/constructors not taking iterators, but having the same number of parameters. But instead of is_iterator, I needed is_input_iterator, is_forward_iterator, etc. These refinements are implemented similar to what Beman shows, but takes into account which std iterator tag the nested iterator_category type is implicitly convertible to. They can also be used instead of tag dispatching for the selection of an optimal algorithm. Howard