class C {
C() try {
void* addr = this;
add_addr_to_static_structure(addr);
// May throw exception
} catch(...) {
void* addr = this; //
< /blockquote>
из ISO C ++ 15.3.10: Почему это неопределенное поведение?, это потому, что члены будут уничтожен до того, как мы введем обработчик. ?
Подробнее здесь: [url]https://stackoverflow.com/questions/79463018/can-i-access-this-from-a-constructors-function-try-handler[/url]
о следующем коде: < /p> [code]class C { C() try { void* addr = this; add_addr_to_static_structure(addr); // May throw exception } catch(...) { void* addr = this; // < /blockquote> из ISO C ++ 15.3.10: Почему это неопределенное поведение?, это потому, что члены будут уничтожен до того, как мы введем обработчик. ?