]> git.lyx.org Git - lyx.git/blob - boost/boost/exception/current_exception_cast.hpp
boost: add eol property
[lyx.git] / boost / boost / exception / current_exception_cast.hpp
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 UUID_7E83C166200811DE885E826156D89593
7 #define UUID_7E83C166200811DE885E826156D89593
8
9 namespace
10 boost
11     {
12     template <class E>
13     inline
14     E *
15     current_exception_cast()
16         {
17         try
18             {
19             throw;
20             }
21         catch(
22         E & e )
23             {
24             return &e;
25             }
26         catch(
27         ...)
28             {
29             return 0;
30             }
31         }
32     }
33
34 #endif