Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:09:14

0001 #ifndef BOOST_SYSTEM_SYSTEM_ERROR_HPP
0002 #define BOOST_SYSTEM_SYSTEM_ERROR_HPP
0003 
0004 // Copyright Beman Dawes 2006
0005 // Copyright Peter Dimov 2021
0006 // Distributed under the Boost Software License, Version 1.0.
0007 // https://www.boost.org/LICENSE_1_0.txt
0008 
0009 #include <boost/system/errc.hpp>
0010 #include <boost/system/detail/error_code.hpp>
0011 #include <string>
0012 #include <stdexcept>
0013 #include <cassert>
0014 
0015 namespace boost
0016 {
0017 namespace system
0018 {
0019 
0020 class BOOST_SYMBOL_VISIBLE system_error: public std::runtime_error
0021 {
0022 private:
0023 
0024     error_code code_;
0025 
0026 public:
0027 
0028     explicit system_error( error_code const & ec ):
0029         std::runtime_error( ec.what() ), code_( ec ) {}
0030 
0031     system_error( error_code const & ec, std::string const & prefix ):
0032         std::runtime_error( prefix + ": " + ec.what() ), code_( ec ) {}
0033 
0034     system_error( error_code const & ec, char const * prefix ):
0035         std::runtime_error( std::string( prefix ) + ": " + ec.what() ), code_( ec ) {}
0036 
0037     system_error( int ev, error_category const & ecat ):
0038         std::runtime_error( error_code( ev, ecat ).what() ), code_( ev, ecat ) {}
0039 
0040     system_error( int ev, error_category const & ecat, std::string const & prefix ):
0041         std::runtime_error( prefix + ": " + error_code( ev, ecat ).what() ), code_( ev, ecat ) {}
0042 
0043     system_error( int ev, error_category const & ecat, char const * prefix ):
0044         std::runtime_error( std::string( prefix ) + ": " + error_code( ev, ecat ).what() ), code_( ev, ecat ) {}
0045 
0046     error_code code() const noexcept
0047     {
0048         return code_;
0049     }
0050 };
0051 
0052 } // namespace system
0053 } // namespace boost
0054 
0055 #endif // BOOST_SYSTEM_SYSTEM_ERROR_HPP