
9 Sep
2004
9 Sep
'04
6:42 p.m.
Arkadiy Vertleyb wrote:
The problem is that you can't specialize (or overload) on a nested types. The Standard clearly says that this is a non-deducible context. So we can't do something like:
template<class V, class T> encode_type<V, T::iterator>{}; // compiler error!
This is VERY unfortunate, and I 've been trying to think of workarounds, but so far I only came up with one that is quite limited and ugly... So I decided to put this on hold.
Can enable_if help you? template<class V, class T, class Enabled = void> struct encode_type; template<class V, class T> struct encode_type<V, T, typename enable_if<has_iterator<T> >::type> { typedef typename T::iterator this_is_what_you_need; }; -- Alexander Nasonov