Boost logo

Boost :

From: Bronek Kozicki (brok_at_[hidden])
Date: 2006-07-04 09:41:47


Kevin Sopp wrote:
> The compiler cannot check that the right tag is used since information is
> added to the exception at runtime, so you're still vulnerable to typos. That
> means you would still have to either put the tags

you only declare them; and if you used different name than declared, compiler
will catch that error. You may also declare that name wherever you want (if
you keep the scope), because multiple declarations are not a problem (as
opposed to multiple definitions). Presumably it would be best to put them in
header files where these data are used.

> or static strings in a

these have to be defined.

> central header file to unify the exception handling code at the throw/catch
> site.

God forbid! "unified" exception handling is not something that boost should
enforfce its users to do. Tags bring nice decoupling with basic static type
safety; strings bring just decoupling OR compiler control with reduntant
declaration/definition. I implemented similar "typeless vehicle for data" some
time ago and I think I'm pretty familiar with its mechanics and potential
(which goes much beyond exception handling).

B.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk