
Jeremy Day wrote:
There are two reasons, really. The first reason is that it isn't something that I have considered before. I have spent essentially zero time looking at the preprocessor library. The second reason is that using the preprocessor just doesn't seem as much fun. I will explore that idea, though, since it is something that I don't have much experience with.
Believe me, Boost.Preprocessor is fun. Overusing it is not fun but it's a more general principle that can be applied to many other C++ features. PP is especially good for libraries. Two reasons why I would consider PP version: 1. catch(...) followed by rethrow might be less efficient than handle-seq. I never measured this, though. 2. catch(...) catches too many things on some compilers. I know only one (very popular) compiler that also catches system exceptions (aka SEH). Though, I don't remember how it rethrows those exceptions. Another possible problem is that a stack trace of original throw instruction might be replaced with subsequent throw inside catch(...). It has been discussed in this thread but only for few compilers, IIRC. -- Alexander Nasonov