1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. 2 3 //Distributed under the Boost Software License, Version 1.0. (See accompanying 4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #ifndef BOOST_EXCEPTION_7E83C166200811DE885E826156D89593 7 #define BOOST_EXCEPTION_7E83C166200811DE885E826156D89593 8 9 #ifndef BOOST_EXCEPTION_ENABLE_WARNINGS 10 #if __GNUC__*100+__GNUC_MINOR__>301 11 #pragma GCC system_header 12 #endif 13 #ifdef __clang__ 14 #pragma clang system_header 15 #endif 16 #ifdef _MSC_VER 17 #pragma warning(push,1) 18 #endif 19 #endif 20 21 namespace 22 boost 23 { 24 template <class E> 25 inline 26 E * current_exception_cast()27 current_exception_cast() 28 { 29 try 30 { 31 throw; 32 } 33 catch( 34 E & e ) 35 { 36 return &e; 37 } 38 catch( 39 ...) 40 { 41 return 0; 42 } 43 } 44 } 45 46 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) 47 #pragma warning(pop) 48 #endif 49 #endif 50