11 May
2004
11 May
'04
7:09 p.m.
It already works. If you want to detect STL sequence-ness, you'll have to try some nasty hacks. I'm have doubts about whether it's even possible to approximate that metafunction in portable code.
Wouldn't something about these lines work? template<typename T> char test( T const&, long ); template<typename T> int test( std::list<T> const&, int ); template<typename T> struct is_list { static T t; enum { value = sizeof( test( t, 0 ) ) == 4; } }; Gennadiy.