Home | History | Annotate | Download | only in detail
      1 //
      2 // detail/throw_error.hpp
      3 // ~~~~~~~~~~~~~~~~~~~~~~
      4 //
      5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
      6 //
      7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
      8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
      9 //
     10 
     11 #ifndef ASIO_DETAIL_THROW_ERROR_HPP
     12 #define ASIO_DETAIL_THROW_ERROR_HPP
     13 
     14 
     15 #include "asio/detail/config.hpp"
     16 #include "asio/error_code.hpp"
     17 
     18 #include "asio/detail/push_options.hpp"
     19 
     20 namespace asio {
     21 namespace detail {
     22 
     23 ASIO_DECL void do_throw_error(const asio::error_code& err);
     24 
     25 ASIO_DECL void do_throw_error(const asio::error_code& err,
     26     const char* location);
     27 
     28 inline void throw_error(const asio::error_code& err)
     29 {
     30   if (err)
     31     do_throw_error(err);
     32 }
     33 
     34 inline void throw_error(const asio::error_code& err,
     35     const char* location)
     36 {
     37   if (err)
     38     do_throw_error(err, location);
     39 }
     40 
     41 } // namespace detail
     42 } // namespace asio
     43 
     44 #include "asio/detail/pop_options.hpp"
     45 
     46 # include "asio/detail/impl/throw_error.ipp"
     47 
     48 #endif // ASIO_DETAIL_THROW_ERROR_HPP
     49