Size: a a a

2020 May 29

DF

Dollar Føølish in pro.cxx
Он конкретно про конструкторы говорит
источник

v

vehlwn in pro.cxx
Dollar Føølish
Ну посмотри на цитату саттера
Куда смотреть? Он говорит что-то про скоп переменных, который кончился в свитче.
источник

DF

Dollar Føølish in pro.cxx
Dollar Føølish
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?).
Вот
источник

DF

Dollar Føølish in pro.cxx
А, прошу прощения я страницей ошибся
источник

DF

Dollar Føølish in pro.cxx
A Step Toward Morality

Incidentally, this also means that the only (repeat only) possible use for a constructor 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 useless
источник

A

Alex Ф-ф-фэils!🌠︙... in pro.cxx
О, приветствую в чате
источник

AK

Alexander Kascheev in pro.cxx
Alex Ф-ф-фэils!🌠︙
О, приветствую в чате
Привет.
источник

A

Alex Ф-ф-фэils!🌠︙... in pro.cxx
Dollar Føølish
A Step Toward Morality

Incidentally, this also means that the only (repeat only) possible use for a constructor 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 useless
Ну да
источник

DF

Dollar Føølish in pro.cxx
Если ты ее не транслирует  то она будет переброшена все равно
источник

DF

Dollar Føølish in pro.cxx
Я об этом уже полчаса говорю
источник

v

vehlwn in pro.cxx
Dollar Føølish
Я об этом уже полчаса говорю
Я этого не вижу.
источник

DF

Dollar Føølish in pro.cxx
Попробуйте на годболте запустить constructor try block любой пример
источник

DF

Dollar Føølish in pro.cxx
Вот любой где случается эксепшн
источник

DF

Dollar Føølish in pro.cxx
Я с телефона,не могу
источник

v

vehlwn in pro.cxx
vehlwn
Я этого не вижу.
Теперь вижу.
Every catch-clause in the function-try-block for a constructor must terminate by throwing an exception. If the control reaches the end of such handler, the current exception is automatically rethrown as if by throw;. The return statement is not allowed in any catch clause of a constructor's function-try-block.
источник

v

vehlwn in pro.cxx
Ну бросает и бросает.
https://wandbox.org/permlink/Pxi117wXRCS2gTwl
источник

v

vehlwn in pro.cxx
Предлагаю запретить ктор мем инит листы и как в джавке и петоне все инициализировать знаком =. Тогда не будет внезапных выбросов исключений в конструкторном функциональном трае.
источник

R

Ruben in pro.cxx
А как в linux лучше послать нотификейшен из одного процесса в другой, чтобы это было через дескриптор и можно было слушать на нем select-ом?
источник

R

Ruben in pro.cxx
pipe?
источник

AS

Anatoly Shirokov in pro.cxx
В @supapro с текстом задания
источник