Line data Source code
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 defined(__GNUC__) && __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 * 27 0 : current_exception_cast() 28 : { 29 : try 30 : { 31 0 : throw; 32 0 : } 33 : catch( 34 : E & e ) 35 : { 36 0 : return &e; 37 0 : } 38 : catch( 39 : ...) 40 : { 41 0 : return 0; 42 0 : } 43 0 : } 44 : } 45 : 46 : #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) 47 : #pragma warning(pop) 48 : #endif 49 : #endif