1 // (C) Copyright 2008-10 Anthony Williams
2 // (C) Copyright 2011-2015 Vicente J. Botet Escriba
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_THREAD_FUTURES_FUTURE_ERROR_HPP
9 #define BOOST_THREAD_FUTURES_FUTURE_ERROR_HPP
11 #include <boost/thread/detail/config.hpp>
13 #include <boost/thread/futures/future_error_code.hpp>
14 #include <boost/system/error_code.hpp>
20 class BOOST_SYMBOL_VISIBLE future_error
21 : public std::logic_error
23 system::error_code ec_;
25 future_error(system::error_code ec)
26 : logic_error(ec.message()),
31 const system::error_code& code() const BOOST_NOEXCEPT
37 class BOOST_SYMBOL_VISIBLE future_uninitialized:
41 future_uninitialized() :
42 future_error(system::make_error_code(future_errc::no_state))
45 class BOOST_SYMBOL_VISIBLE broken_promise:
50 future_error(system::make_error_code(future_errc::broken_promise))
53 class BOOST_SYMBOL_VISIBLE future_already_retrieved:
57 future_already_retrieved():
58 future_error(system::make_error_code(future_errc::future_already_retrieved))
61 class BOOST_SYMBOL_VISIBLE promise_already_satisfied:
65 promise_already_satisfied():
66 future_error(system::make_error_code(future_errc::promise_already_satisfied))
70 class BOOST_SYMBOL_VISIBLE task_already_started:
74 task_already_started():
75 future_error(system::make_error_code(future_errc::promise_already_satisfied))
79 class BOOST_SYMBOL_VISIBLE task_moved:
84 future_error(system::make_error_code(future_errc::no_state))
93 future_error(system::make_error_code(future_errc::no_state))