#ifndef GENERS_IOISWRITABLE_HH_ #define GENERS_IOISWRITABLE_HH_ #include "geners/IOIsClassType.hh" namespace gs { template class IOIsWritableHelper { private: template struct tester; typedef char One; typedef struct {char a[2];} Two; template static One test(tester<&C::write>*); template static Two test(...); public: enum {value = sizeof(test(0)) == 1}; }; template::value> struct IOIsWritable { enum {value = 0}; }; template struct IOIsWritable { enum {value = IOIsWritableHelper::value}; }; } #endif // GENERS_IOISWRITABLE_HH_