epoc32/include/stdapis/boost/throw_exception.hpp
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
#ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
williamr@4
     2
#define BOOST_THROW_EXCEPTION_HPP_INCLUDED
williamr@4
     3
williamr@4
     4
// MS compatible compilers support #pragma once
williamr@4
     5
williamr@4
     6
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
williamr@4
     7
# pragma once
williamr@4
     8
#endif
williamr@4
     9
williamr@4
    10
//
williamr@4
    11
//  boost/throw_exception.hpp
williamr@4
    12
//
williamr@4
    13
//  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
williamr@4
    14
//
williamr@4
    15
// Distributed under the Boost Software License, Version 1.0. (See
williamr@4
    16
// accompanying file LICENSE_1_0.txt or copy at
williamr@4
    17
// http://www.boost.org/LICENSE_1_0.txt)
williamr@4
    18
//
williamr@4
    19
//  http://www.boost.org/libs/utility/throw_exception.html
williamr@4
    20
//
williamr@4
    21
williamr@4
    22
#include <boost/config.hpp>
williamr@4
    23
williamr@4
    24
#ifdef BOOST_NO_EXCEPTIONS
williamr@4
    25
# include <exception>
williamr@4
    26
#endif
williamr@4
    27
williamr@4
    28
namespace boost
williamr@4
    29
{
williamr@4
    30
williamr@4
    31
#ifdef BOOST_NO_EXCEPTIONS
williamr@4
    32
williamr@4
    33
void throw_exception(std::exception const & e); // user defined
williamr@4
    34
williamr@4
    35
#else
williamr@4
    36
williamr@4
    37
template<class E> inline void throw_exception(E const & e)
williamr@4
    38
{    
williamr@4
    39
//Adding this #if statement for WINSCW because currently winscw compiler does not support catching of const exception by non const catch blocks
williamr@4
    40
//Once compiler starts supporting, this #if statement needs to be removed
williamr@4
    41
#if ( defined __WINSCW__)
williamr@4
    42
    E a = e;
williamr@4
    43
    throw a;
williamr@4
    44
#else
williamr@4
    45
    throw e;
williamr@4
    46
#endif
williamr@4
    47
}
williamr@4
    48
williamr@4
    49
#endif
williamr@4
    50
williamr@4
    51
} // namespace boost
williamr@4
    52
williamr@4
    53
#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED