4 ms·
Every C++ book I even read mentions function-level try blocks. Unfortunately, they are rarely useful due to scope semantics (it's difficult to perform shared cl
by tenfingers 13y ago
Every C++ book I even read mentions function-level try blocks. Unfortunately, they are rarely useful due to scope semantics (it's difficult to perform shared cleanup, even when using object guards).
- mattgreenrocks 13y agoFWIW, I have never seen this, and I have quite a few C++ books on my shelf. I either missed it repeatedly, or it is so obscure that it never came up.
- nikbackm 13y agoThey are included in TC++PL at least. But so is everything else in C++ :) They are probably obscure because they are only really useful for logging or remapping exceptions (unless a new exception is thrown the original one will be re-thrown at the end of the catch-block) in constructors and destructors. They can be used in normal functions as well, but offers nothing beyond what normal try-blocks do there.
- pjmlp 13y agoMy copy of the book is currently 2000 km away from me, but I think the "C++ ARM" already mentioned it, does anyone know?