New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
current_exception_cast.hpp in vendors/XIOS/current/extern/boost/include/boost/exception – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/exception/current_exception_cast.hpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 953 bytes
Line 
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#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
9#pragma GCC system_header
10#endif
11#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
12#pragma warning(push,1)
13#endif
14
15namespace
16boost
17    {
18    template <class E>
19    inline
20    E *
21    current_exception_cast()
22        {
23        try
24            {
25            throw;
26            }
27        catch(
28        E & e )
29            {
30            return &e;
31            }
32        catch(
33        ...)
34            {
35            return 0;
36            }
37        }
38    }
39
40#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
41#pragma warning(pop)
42#endif
43#endif
Note: See TracBrowser for help on using the repository browser.