diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-08 03:09:47 +0000 |
---|---|---|
committer | <> | 2015-05-05 14:37:32 +0000 |
commit | f2541bb90af059680aa7036f315f052175999355 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /boost/polymorphic_cast.hpp | |
parent | ed232fdd34968697a68783b3195b1da4226915b5 (diff) | |
download | boost-tarball-master.tar.gz |
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'boost/polymorphic_cast.hpp')
-rw-r--r-- | boost/polymorphic_cast.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/boost/polymorphic_cast.hpp b/boost/polymorphic_cast.hpp index 03013c718..70afa6be2 100644 --- a/boost/polymorphic_cast.hpp +++ b/boost/polymorphic_cast.hpp @@ -1,6 +1,7 @@ // boost polymorphic_cast.hpp header file ----------------------------------------------// // (C) Copyright Kevlin Henney and Dave Abrahams 1999. +// (C) Copyright Boris Rasin 2014. // Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -8,6 +9,9 @@ // See http://www.boost.org/libs/conversion for Documentation. // Revision History +// 10 Nov 14 polymorphic_pointer_downcast moved to a separate header, +// minor improvements to stisfy latest Boost coding style +// 08 Nov 14 Add polymorphic_pointer_downcast (Boris Rasin) // 09 Jun 14 "cast.hpp" was renamed to "polymorphic_cast.hpp" and // inclusion of numeric_cast was removed (Antony Polukhin) // 23 Jun 05 numeric_cast removed and redirected to the new verion (Fernando Cacciola) @@ -47,8 +51,13 @@ # include <boost/config.hpp> # include <boost/assert.hpp> +# include <boost/throw_exception.hpp> # include <typeinfo> +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + namespace boost { // See the documentation for descriptions of how to choose between @@ -64,7 +73,7 @@ namespace boost inline Target polymorphic_cast(Source* x) { Target tmp = dynamic_cast<Target>(x); - if ( tmp == 0 ) throw std::bad_cast(); + if ( tmp == 0 ) boost::throw_exception( std::bad_cast() ); return tmp; } |