Код: Выделить всё
struct StructNoImplementaion;
struct StructWithImplementation {
StructWithImplementation(int m) : member1(m) {}
int member1;
};
int main()
{
StructWithImplementation s73(3);
// no error
StructNoImplementaion* p73 = reinterpret_cast(&s73);
// error: cannot convert from 'StructWithImplemetation' to 'StructNoImplementation'
//StructNoImplementaion* p73 = static_cast(&s73);
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... ss-pointer
Мобильная версия