4 ms·
Throwing from the middle of a constructor in C++ is a quagmire, so it's best not to do it https://isocpp.org/wiki/faq/exceptions#ctors-can-throw https://isocpp
by stinos 7y ago
Throwing from the middle of a constructor in C++ is a quagmire, so it's best not to do it
https://isocpp.org/wiki/faq/exceptions#ctors-can-throw https://isocpp.org/wiki/faq/exceptions#ctors-can-throw for one disagrees, but it might not cover what you mean exactly. So: also in modern C++ (i.e. using RAII types)? Or do you mean other problems than leaking, do you have an example?
- UncleMeat 7y agoEven though cpp11 has been around a while, there is a ton of code that isn't using smart pointers everywhere. This makes exception handling messy, especially with partially constructed objects.