]> git.lyx.org Git - lyx.git/blob - boost/boost/exception/current_exception_cast.hpp
boost: update to version 1.40
[lyx.git] / boost / boost / exception / current_exception_cast.hpp
1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
2 \r
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying\r
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
5 \r
6 #ifndef UUID_7E83C166200811DE885E826156D89593\r
7 #define UUID_7E83C166200811DE885E826156D89593\r
8 \r
9 namespace\r
10 boost\r
11     {\r
12     template <class E>\r
13     inline\r
14     E *\r
15     current_exception_cast()\r
16         {\r
17         try\r
18             {\r
19             throw;\r
20             }\r
21         catch(\r
22         E & e )\r
23             {\r
24             return &e;\r
25             }\r
26         catch(\r
27         ...)\r
28             {\r
29             return 0;\r
30             }\r
31         }\r
32     }\r
33 \r
34 #endif\r