/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/Utilities/interface/getAnyPtr.h
14 строк
358 B
Chris Jones
Removed undefined use of union in getAnyPtr
27 авг 2021, 20:30
27 авг 2021, 20:30
3a45d60
Код
Авторство
О чём код?
#ifndef FWCore_Utilities_getAnyPtr_h #define FWCore_Utilities_getAnyPtr_h #include <cassert> #include <memory> namespace edm { template <typename T> inline std::unique_ptr<T> getAnyPtr(void *p, int offset) { return std::unique_ptr<T>(static_cast<T *>(static_cast<void *>(static_cast<unsigned char *>(p) + offset))); } } // namespace edm #endif