#ifndef GENERS_IOISREADABLE_HH_ #define GENERS_IOISREADABLE_HH_ #include "geners/ClassId.hh" #include "geners/IOIsClassType.hh" #include "geners/StrippedType.hh" namespace gs { template class IOIsHeapReadableHelper { private: template struct tester; typedef char One; typedef struct {char a[2];} Two; template static One test(tester<&C::read>*); template static Two test(...); public: enum {value = sizeof(test(0)) == 1}; }; template::value> struct IOIsHeapReadable { enum {value = 0}; }; template struct IOIsHeapReadable { enum {value = IOIsHeapReadableHelper::type>::value}; }; template class IOIsPlaceReadableHelper { private: template struct tester; typedef char One; typedef struct {char a[2];} Two; template static One test(tester<&C::restore>*); template static Two test(...); public: enum {value = sizeof(test(0)) == 1}; }; template::value> struct IOIsPlaceReadable { enum {value = 0}; }; template struct IOIsPlaceReadable { enum {value = IOIsPlaceReadableHelper::type>::value}; }; } #endif // GENERS_IOISREADABLE_HH_