170 похожих чатов

Function try block is to translate an exception thrown from

a base or member subobject. That's Moral #1. Moral #2 says that destructor function try blocks are entirely usele—

“—But wait!” I hear someone interrupting from the middle of the room. “I don't agree with Moral #1. I can think of another possible use for constructor function try blocks—to free resources allocated in the initializer list or in the constructor body!”

Sorry, no. Remember that once you get into your constructor try block's handler, any local variables in the constructor body are also already out of scope, and you are guaranteed that no base subobjects or member objects exist anymore, period. You can't even refer to their names. Either the parts of your object were never constructed, or those that were constructed have already been destroyed. So you can't be cleaning up anything that relies on referring to a base or member of the class (and anyway, that's what the base and member destructors are for, right?).

1 ответов

7 просмотров

Вот

Похожие вопросы

Обсуждают сегодня

Hi there everyone Is there anyone who have not started hamster bot yet? I need only one, I'll be glad if you do this for me DM if you haven't yet
Mehrshad
53
why some site like google has separate page for username/email and password?
Mr Thieves
21
Может быть небольшое отступление, но я тут решил обратить внимание на то, сколько весит хелловорлд на с++... Зачем он весит почти 250 Кб? У меня оконное приложение на фасме ве...
The Bird of Hermes
13
What do you wanna learn?
Malware ( DM = BLOCK )
12
А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
131
Всем привет. Программно добавляю документы в таблицу site_content в конце очищаю кеш $modx->clearCache(); Но документы появляются в дереве только после того как редактирую ...
Владимир
8
Подскажите, сейчас что то есть (JS модуль какой-нибудь), что можно использовать для: 1) переваривания javascript codа из html fileа, т.е. разбивки, на переменные, команды, бло...
Iar De
32
Мне интересно, скорее людей здесь используют D, Rust, C/C++ для решения реальных прикладных задач за деньги?)
Evil Satanson
43
кто поможет крякнуть чит? (реверс инжиринг) чтобы разблокировать премиум версию
Mёdkinson Medvezhkin
40
какие клиентские датасеты в лазаре умеют объединяться в master-detail? нужно забрать на клиент запись из одной таблицы и выборку из другой связанной один-ко-многим, отредактир...
Igor
19
Карта сайта