Chris@102: // (C) Copyright 2008-10 Anthony Williams Chris@102: // (C) Copyright 2011-2012,2015 Vicente J. Botet Escriba Chris@102: // Chris@102: // Distributed under the Boost Software License, Version 1.0. (See Chris@102: // accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: #ifndef BOOST_THREAD_FUTURES_FUTURE_ERROR_CODE_HPP Chris@102: #define BOOST_THREAD_FUTURES_FUTURE_ERROR_CODE_HPP Chris@102: Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: Chris@102: namespace boost Chris@102: { Chris@102: Chris@102: //enum class future_errc Chris@102: BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc) Chris@102: { Chris@102: broken_promise = 1, Chris@102: future_already_retrieved, Chris@102: promise_already_satisfied, Chris@102: no_state Chris@102: } Chris@102: BOOST_SCOPED_ENUM_DECLARE_END(future_errc) Chris@102: Chris@102: namespace system Chris@102: { Chris@102: template <> Chris@102: struct BOOST_SYMBOL_VISIBLE is_error_code_enum< ::boost::future_errc> : public true_type {}; Chris@102: Chris@102: #ifdef BOOST_NO_CXX11_SCOPED_ENUMS Chris@102: template <> Chris@102: struct BOOST_SYMBOL_VISIBLE is_error_code_enum< ::boost::future_errc::enum_type> : public true_type { }; Chris@102: #endif Chris@102: } // system Chris@102: Chris@102: BOOST_THREAD_DECL Chris@102: const system::error_category& future_category() BOOST_NOEXCEPT; Chris@102: Chris@102: namespace system Chris@102: { Chris@102: inline Chris@102: error_code Chris@102: make_error_code(future_errc e) BOOST_NOEXCEPT Chris@102: { Chris@102: return error_code(underlying_cast(e), boost::future_category()); Chris@102: } Chris@102: Chris@102: inline Chris@102: error_condition Chris@102: make_error_condition(future_errc e) BOOST_NOEXCEPT Chris@102: { Chris@102: return error_condition(underlying_cast(e), boost::future_category()); Chris@102: } Chris@102: } // system Chris@102: } // boost Chris@102: Chris@102: #endif // header