From 0be5ccf5c7fb58f8fae7f5d66819ee4b5e7c278c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 17 Nov 2015 16:38:59 +1100 Subject: [PATCH] cast: style --- cast.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); }