Skip to content

Commit

Permalink
Revert "make_error_code used for future_error"
Browse files Browse the repository at this point in the history
This reverts commit b3d47f5.
  • Loading branch information
volcoma committed Nov 11, 2024
1 parent b3d47f5 commit 25ab48c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions itc/detail/future_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct basic_state

if(ready())
{
throw std::future_error(std::make_error_code(std::future_errc::promise_already_satisfied));
throw std::future_error(std::future_errc::promise_already_satisfied);
}
exception = std::move(ex);
set_ready(lock, value_status::error);
Expand Down Expand Up @@ -143,7 +143,7 @@ struct future_state : public basic_state<T>

if(this->ready())
{
throw std::future_error(std::make_error_code(std::future_errc::promise_already_satisfied));
throw std::future_error(std::future_errc::promise_already_satisfied);
}

this->value = std::make_shared<std::decay_t<V>>(std::forward<V>(val));
Expand All @@ -165,7 +165,7 @@ struct future_state : public basic_state<T>
}
else
{
throw std::future_error(std::make_error_code(std::future_errc::broken_promise));
throw std::future_error(std::future_errc::broken_promise);
}
}
};
Expand All @@ -179,7 +179,7 @@ struct future_state<void> : public basic_state<void>

if(ready())
{
throw std::future_error(std::make_error_code(std::future_errc::promise_already_satisfied));
throw std::future_error(std::future_errc::promise_already_satisfied);
}

set_ready(lock, value_status::ready);
Expand All @@ -195,7 +195,7 @@ inline void check_state(const std::shared_ptr<future_state<T>>& state)
{
if(!state)
{
throw std::future_error(std::make_error_code(std::future_errc::no_state));
throw std::future_error(std::future_errc::no_state);
}
}

Expand Down
4 changes: 2 additions & 2 deletions itc/future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class basic_promise
//-----------------------------------------------------------------------------
void abandon()
{
auto exception = std::make_exception_ptr(std::future_error(std::make_error_code(std::future_errc::broken_promise)));
auto exception = std::make_exception_ptr(std::future_error(std::future_errc::broken_promise));
set_exception(exception);
}

Expand All @@ -234,7 +234,7 @@ class basic_promise

if(state_->retrieved.test_and_set())
{
throw std::future_error(std::make_error_code(std::future_errc::future_already_retrieved));
throw std::future_error(std::future_errc::future_already_retrieved);
}
}

Expand Down

0 comments on commit 25ab48c

Please sign in to comment.