struct A {
int n;
double d;
};
int main() {
auto a = A{.n = 1, .d = 3.14};
// error: static_cast from 'int*' to 'A*' is not allowed
auto _ = static_cast(&a.n);
}
Рассмотрим следующий код: < /p> [code]struct A { int n; double d; };
int main() { auto a = A{.n = 1, .d = 3.14};
// error: static_cast from 'int*' to 'A*' is not allowed auto _ = static_cast(&a.n); } [/code] см. https://godbolt.org/z/8814seh79образное. pointer-interconvertible if: [list] [*]they are the same object, or [*]one is a union object and the other is a non-static data member of that object, or [*][b]one is a standard-layout class object and the other is the first non-static data member of that object[/b] or any base class Subobject этого объекта, или [*] Существует объект C, такой, что A и C являются pointer-interconbentible, а C и B pointer-interconbentible. [/list]
Недавно я настроил веб-сайт на VPS, и хотя я могу подтвердить, что мой сервер работает (я вижу сообщение «Веб-сайт работает нормально»), попытка получить доступ к любой странице моего домена приводит к ошибке « Ошибка 404 «Не найдено».