File indexing completed on 2025-01-18 09:52:47
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_THREAD_FUTURES_FUTURE_ERROR_CODE_HPP
0009 #define BOOST_THREAD_FUTURES_FUTURE_ERROR_CODE_HPP
0010
0011 #include <boost/thread/detail/config.hpp>
0012 #include <boost/core/scoped_enum.hpp>
0013 #include <boost/system/error_code.hpp>
0014 #include <boost/type_traits/integral_constant.hpp>
0015
0016 namespace boost
0017 {
0018
0019
0020 BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
0021 {
0022 broken_promise = 1,
0023 future_already_retrieved,
0024 promise_already_satisfied,
0025 no_state
0026 }
0027 BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
0028
0029 namespace system
0030 {
0031 template <>
0032 struct BOOST_SYMBOL_VISIBLE is_error_code_enum< ::boost::future_errc> : public true_type {};
0033
0034 #ifdef BOOST_NO_CXX11_SCOPED_ENUMS
0035 template <>
0036 struct BOOST_SYMBOL_VISIBLE is_error_code_enum< ::boost::future_errc::enum_type> : public true_type { };
0037 #endif
0038 }
0039
0040 BOOST_THREAD_DECL
0041 const system::error_category& future_category() BOOST_NOEXCEPT;
0042
0043 namespace system
0044 {
0045 inline
0046 error_code
0047 make_error_code(future_errc e) BOOST_NOEXCEPT
0048 {
0049 return error_code(underlying_cast<int>(e), boost::future_category());
0050 }
0051
0052 inline
0053 error_condition
0054 make_error_condition(future_errc e) BOOST_NOEXCEPT
0055 {
0056 return error_condition(underlying_cast<int>(e), boost::future_category());
0057 }
0058 }
0059 }
0060
0061 #endif