Commit 6128f71c authored by Kirk Shoop's avatar Kirk Shoop Committed by Facebook Github Bot

remove _v that are not yet supported

Summary:
fixed some compile errors when building SMC with pushmi as a dependency

some _v traits do not exist

a specialization of ManualLifetime<void> was required

Reviewed By: yfeldblum

Differential Revision: D14939161

fbshipit-source-id: 76a1f05d7ce889d00fdf4a264e5e719fdb12d4ac
parent 8e706ec6
......@@ -36,9 +36,9 @@ class ManualLifetime {
template <
typename... Args,
std::enable_if_t<std::is_constructible_v<T, Args...>, int> = 0>
std::enable_if_t<std::is_constructible<T, Args...>::value, int> = 0>
void construct(Args&&... args) noexcept(
noexcept(std::is_nothrow_constructible_v<T, Args...>)) {
noexcept(std::is_nothrow_constructible<T, Args...>::value)) {
new (static_cast<void*>(std::addressof(value_)))
T(static_cast<Args&&>(args)...);
}
......@@ -110,6 +110,16 @@ class ManualLifetime<T&&> {
T* ptr_;
};
template <>
class ManualLifetime<void> {
public:
void construct() noexcept {}
void destruct() noexcept {}
void get() const noexcept {}
};
} // namespace detail
} // namespace coro
} // namespace folly
......@@ -75,7 +75,7 @@ private:
requires ConvertibleTo<U, value_type> //
) //
void value(U&& value)
noexcept(std::is_nothrow_constructible_v<value_type, U>) {
noexcept(std::is_nothrow_constructible<value_type, U>::value) {
this_->value_.construct(static_cast<U&&>(value));
this_->state_ = state::value;
}
......@@ -96,7 +96,7 @@ private:
template<typename Error>
void error(Error error) noexcept {
assert(this_->state_ != state::value);
PUSHMI_IF_CONSTEXPR( (std::is_same_v<Error, std::exception_ptr>) (
PUSHMI_IF_CONSTEXPR( (std::is_same<Error, std::exception_ptr>::value) (
this_->exception_.construct(std::move(error));
) else (
this_->exception_.construct(std::make_exception_ptr(std::move(error)));
......@@ -113,13 +113,13 @@ public:
: sender_(std::addressof(sender))
{}
sender_awaiter(sender_awaiter &&that)
noexcept(std::is_nothrow_move_constructible_v<value_type> ||
std::is_void_v<value_type>)
noexcept(std::is_nothrow_move_constructible<value_type>::value ||
std::is_void<value_type>::value)
: sender_(std::exchange(that.sender_, nullptr))
, continuation_{std::exchange(that.continuation_, {})}
, state_(that.state_) {
if (that.state_ == state::value) {
PUSHMI_IF_CONSTEXPR( (!std::is_void_v<value_type>) (
PUSHMI_IF_CONSTEXPR( (!std::is_void<value_type>::value) (
id(value_).construct(std::move(that.value_).get());
) else (
))
......
......@@ -118,7 +118,7 @@ PUSHMI_CONCEPT_DEF(
// template<typename...Args>
// using result_t =
// std::conditional_t<
// std::is_void_v<result_t<Args...>>,
// std::is_void<result_t<Args...>>::value,
// Tuple<>,
// Tuple<result_t<Args...>>>;
// };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment