Вопрос

I have data structure which stores POD-structs (each instantiation stores a single type only, since it is basically an array of a specific POD-struct). Sometimes another dev. will modify one of these structs, adding or modifying a data type. If a non-POD element is added, e.g. std::string, the data structure blows-up at runtime, because the memory model changes. Is there any way to detect if a class or struct is POD-compliant using compiler defines or a call at run-time (to avoid this maintainence issue) ? I'm using g++ (GCC) 4.2.4.

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top