Files
boost_system/include/boost/system/error_code.hpp
T

56 lines
1.7 KiB
C++
Raw Normal View History

2018-09-16 03:04:19 +03:00
#ifndef BOOST_SYSTEM_ERROR_CODE_HPP_INCLUDED
#define BOOST_SYSTEM_ERROR_CODE_HPP_INCLUDED
// Copyright Beman Dawes 2006, 2007
// Copyright Christoper Kohlhoff 2007
2018-01-22 21:13:02 +02:00
// Copyright Peter Dimov 2017, 2018
2018-09-16 03:04:19 +03:00
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
2018-09-16 03:04:19 +03:00
//
// See library home page at http://www.boost.org/libs/system
2020-08-27 16:15:10 +03:00
#include <boost/system/detail/error_code.hpp>
#include <boost/system/error_category.hpp>
#include <boost/system/error_condition.hpp>
#include <boost/system/errc.hpp>
#include <boost/system/detail/generic_category.hpp>
#include <boost/system/detail/system_category.hpp>
#include <boost/system/detail/system_category_impl.hpp>
2020-08-27 03:06:14 +03:00
#include <boost/system/detail/throws.hpp>
2018-09-16 03:04:19 +03:00
#include <boost/config.hpp>
2018-09-17 02:55:40 +03:00
namespace boost
{
2018-09-15 20:05:10 +03:00
namespace system
{
2018-09-16 03:04:19 +03:00
// non-member functions of error_code and error_condition
inline bool operator==( const error_code & code, const error_condition & condition ) BOOST_NOEXCEPT
2018-09-15 20:05:10 +03:00
{
return code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() );
}
inline bool operator!=( const error_code & lhs, const error_condition & rhs ) BOOST_NOEXCEPT
2018-09-15 20:05:10 +03:00
{
return !( lhs == rhs );
}
inline bool operator==( const error_condition & condition, const error_code & code ) BOOST_NOEXCEPT
2018-09-15 20:05:10 +03:00
{
2018-10-02 02:59:03 +03:00
return code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() );
2018-09-15 20:05:10 +03:00
}
inline bool operator!=( const error_condition & lhs, const error_code & rhs ) BOOST_NOEXCEPT
2018-09-15 20:05:10 +03:00
{
return !( lhs == rhs );
}
} // namespace system
} // namespace boost
2018-09-16 03:04:19 +03:00
#endif // BOOST_SYSTEM_ERROR_CODE_HPP_INCLUDED