
Arkadiy Vertleyb wrote:
"David Abrahams" <dave@boost-consulting.com> wrote
Peder Holt wrote:
given a metafunction is_iterator<> there may be a way around this
problem:
Problem is, it's impossible to write that metafunction.
Well, it's not possible in general case, but for the purpose of typeof, a rough approximation may be enough. We can just assume that, if the type was not caught by all the specializations (generated by registration), then it *might be* one of the standard iterators. We can use SFINAE, examining value_type, distance_type, etc., to increase the probability of that assumption.
As long as you don't mind access violations when one of those typedefs happens to be present, but private. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com