throw_error.hpp
Go to the documentation of this file.
00001 //
00002 // throw_error.hpp
00003 // ~~~~~~~~~~~~~~~
00004 //
00005 // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
00006 //
00007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
00008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00009 //
00010 
00011 #ifndef ASIO_DETAIL_THROW_ERROR_HPP
00012 #define ASIO_DETAIL_THROW_ERROR_HPP
00013 
00014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
00015 # pragma once
00016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
00017 
00018 #include "asio/detail/push_options.hpp"
00019 
00020 #include "asio/detail/push_options.hpp"
00021 #include <boost/throw_exception.hpp>
00022 #include "asio/detail/pop_options.hpp"
00023 
00024 #include "asio/error_code.hpp"
00025 #include "asio/system_error.hpp"
00026 
00027 namespace asio {
00028 namespace detail {
00029 
00030 inline void throw_error(const asio::error_code& err)
00031 {
00032   if (err)
00033   {
00034     asio::system_error e(err);
00035     boost::throw_exception(e);
00036   }
00037 }
00038 
00039 } // namespace detail
00040 } // namespace asio
00041 
00042 #include "asio/detail/pop_options.hpp"
00043 
00044 #endif // ASIO_DETAIL_THROW_ERROR_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Castor
Author(s): Carpe Noctem
autogenerated on Fri Nov 8 2013 11:05:39