/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Alignment/Geners/interface/IOIsWritable.hh
38 строк
872 B
Cms Build
Clang-Format
08 май 2019, 15:16
08 май 2019, 15:16
7614b05
Код
Авторство
О чём код?
#ifndef GENERS_IOISWRITABLE_HH_ #define GENERS_IOISWRITABLE_HH_ #include "Alignment/Geners/interface/IOIsClassType.hh" #include <ostream> namespace gs { template <typename T> class IOIsWritableHelper { private: template <bool (T::*)(std::ostream &) const> struct tester; typedef char One; typedef struct { char a[2]; } Two; template <typename C> static One test(tester<&C::write> *); template <typename C> static Two test(...); public: enum { value = sizeof(IOIsWritableHelper<T>::template test<T>(nullptr)) == 1 }; }; template <typename T, bool is_class_type = IOIsClassType<T>::value> struct IOIsWritable { enum { value = 0 }; }; template <typename T> struct IOIsWritable<T, true> { enum { value = IOIsWritableHelper<T>::value }; }; } // namespace gs #endif // GENERS_IOISWRITABLE_HH_