I am currently doing some template metaprogramming. In my case I can handle any \"iteratable\" type, i.e. any type for which a typedef foo const_iterator
exists in
If you simply want if a given type contains const_iterator
then following is a simplified version of your code:
template
struct void_ { typedef void type; };
template
struct Foo {};
template
struct Foo ::type> {
void do_stuff(){ ... }
};
See this answer for some explanation of how this technique works.