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
Here's another version of a member type trait check:
template
struct has_const_iterator
{
private:
typedef char yes;
typedef struct { char array[2]; } no;
template static yes test(typename C::const_iterator*);
template static no test(...);
public:
static const bool value = sizeof(test(0)) == sizeof(yes);
};