|
Boost : |
Subject: Re: [boost] [assert] static_assert envy
From: Robert Kawulak (robert.kawulak_at_[hidden])
Date: 2011-01-18 19:07:51
> From: Patrick Horgan
> > You could equally well ask what is the real utility of having
> > C++-style casts over the C-style one. ;-)
> It's a bad analogy. The BOOST_FAIL_MSG and it's ilk just overlays
> another level of indirection. It adds more complexity. C++ style casts
> reduce complexity.
I can't agree. The macros reduce complexity by simplifying the boolean expressions and by being more descriptive, thus better
expressing the author's intention.
And one could argue that C++ casts may add complexity as well, e.g. when you have
const_cast<derived*>(dynamic_cast<const derived*>(const_base_ptr))
instead of
(derived *) const_base_ptr
Yet they are good, because, just like the macros, they tell more precisely what is done and will make it way harder to write
something different than you intended.
Regards,
Robert
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk