diff --git a/cast.hpp b/cast.hpp index 90e8129d..3868a94b 100644 --- a/cast.hpp +++ b/cast.hpp @@ -98,13 +98,14 @@ trunc_cast (U u) } -///---------------------------------------------------------------------------- +/////////////////////////////////////////////////////////////////////////////// /// assert if the value is not a pointer to a subclass of T, else return the /// converted value. Note: this is only a debug-time check and is compiled out /// in optimised builds. template T* -known_cast (V *v) { +known_cast (V *v) +{ CHECK (dynamic_cast (v)); return static_cast (v); } @@ -113,7 +114,8 @@ known_cast (V *v) { //----------------------------------------------------------------------------- template T& -known_cast (V &v) { +known_cast (V &v) +{ CHECK_NOTHROW (dynamic_cast (v)); return static_cast (v); }