62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
// (C) Copyright 2008-10 Anthony Williams
|
|
// (C) Copyright 2011-2012,2015 Vicente J. Botet Escriba
|
|
//
|
|
// 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)
|
|
|
|
#ifndef ACTIV_BOOST_THREAD_FUTURES_FUTURE_ERROR_CODE_HPP
|
|
#define ACTIV_BOOST_THREAD_FUTURES_FUTURE_ERROR_CODE_HPP
|
|
|
|
#include <ActivBoost/thread/detail/config.hpp>
|
|
#include <ActivBoost/core/scoped_enum.hpp>
|
|
#include <ActivBoost/system/error_code.hpp>
|
|
#include <ActivBoost/type_traits/integral_constant.hpp>
|
|
|
|
namespace Boost
|
|
{
|
|
|
|
//enum class future_errc
|
|
ACTIV_BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
|
|
{
|
|
broken_promise = 1,
|
|
future_already_retrieved,
|
|
promise_already_satisfied,
|
|
no_state
|
|
}
|
|
ACTIV_BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
|
|
|
|
namespace system
|
|
{
|
|
template <>
|
|
struct ACTIV_BOOST_SYMBOL_VISIBLE is_error_code_enum< ::Boost::future_errc> : public true_type {};
|
|
|
|
#ifdef ACTIV_BOOST_NO_CXX11_SCOPED_ENUMS
|
|
template <>
|
|
struct ACTIV_BOOST_SYMBOL_VISIBLE is_error_code_enum< ::Boost::future_errc::enum_type> : public true_type { };
|
|
#endif
|
|
} // system
|
|
|
|
ACTIV_BOOST_THREAD_DECL
|
|
const system::error_category& future_category() ACTIV_BOOST_NOEXCEPT;
|
|
|
|
namespace system
|
|
{
|
|
inline
|
|
error_code
|
|
make_error_code(future_errc e) ACTIV_BOOST_NOEXCEPT
|
|
{
|
|
return error_code(underlying_cast<int>(e), Boost::future_category());
|
|
}
|
|
|
|
inline
|
|
error_condition
|
|
make_error_condition(future_errc e) ACTIV_BOOST_NOEXCEPT
|
|
{
|
|
return error_condition(underlying_cast<int>(e), Boost::future_category());
|
|
}
|
|
} // system
|
|
} // boost
|
|
|
|
#endif // header
|