Skip to content

Commit

Permalink
MSVC workaround attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jan 14, 2025
1 parent 7a007e9 commit 858a9b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thrust/thrust/optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -1998,23 +1998,23 @@ _CCCL_HOST_DEVICE constexpr auto optional_map_impl(Opt&& opt, F&& f)
return opt.has_value() ? detail::invoke(std::forward<F>(f), *std::forward<Opt>(opt)) : optional<Ret>(nullopt);
}

_CCCL_SUPPRESS_DEPRECATED_PUSH
_CCCL_EXEC_CHECK_DISABLE
template <class Opt,
class F,
class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Opt>())),
detail::enable_if_t<std::is_void<Ret>::value>* = nullptr>
_CCCL_HOST_DEVICE auto optional_map_impl(Opt&& opt, F&& f)
{
_CCCL_SUPPRESS_DEPRECATED_PUSH
if (opt.has_value())
{
detail::invoke(std::forward<F>(f), *std::forward<Opt>(opt));
return make_optional(monostate{});
}
_CCCL_SUPPRESS_DEPRECATED_POP

return optional<monostate>(nullopt);
}
_CCCL_SUPPRESS_DEPRECATED_POP
# else
_CCCL_EXEC_CHECK_DISABLE
template <class Opt,
Expand Down

0 comments on commit 858a9b0

Please sign in to comment.