
"David Abrahams" <dave@boost-consulting.com> wrote
Arkadiy Vertleyb wrote:
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.
I didn't think about it, and I didn't realise SFINAE can't handle private typedefs. However recall that this applies only to types not registered in a normal way. So, for these types only, we would get an error: can't access private typedef Foo::value_type instead of encode_type is not defined for the type Foo Not very nice, but arguably not an unreasonable price to pay for the ability to register standard iterators on the typeof library level... Unfortunately the problem doesn't seem to get solved anyway... Arkadiy