mardi 23 juillet 2019

One common try-catch block or Many small try-catch blocks

Is it okay to have multiple try-catch blocks? Will it affect the performance?

In C++11, methods like make_shared, make_unique could throw std::bad_alloc exception. To have a try-catch block in all the places where we create it might result in huge code size increase.

How to tackle this? Or do we have any elegant way to solve this?

Aucun commentaire:

Enregistrer un commentaire