#ifndef GENERS_IOISCONTAINER_HH_ #define GENERS_IOISCONTAINER_HH_ #include namespace gs { // In the following template, enum "IsContainer" is evaluated to 1 // at compile time if T has T::value_type typedef template class IOIsContainer { private: typedef char One; typedef struct {char a[2];} Two; template static One test(typename C::value_type const*); template static Two test(...); public: enum {value = sizeof(test(0)) == 1}; }; // Char strings get a special treatment template <> class IOIsContainer { public: enum {value = 0}; }; template <> class IOIsContainer { public: enum {value = 0}; }; template <> class IOIsContainer { public: enum {value = 0}; }; template <> class IOIsContainer { public: enum {value = 0}; }; } #endif // GENERS_IOISCONTAINER_HH_