Skip to content

Commit

Permalink
Update reference_wrapper.h
Browse files Browse the repository at this point in the history
  • Loading branch information
lackhole committed Oct 19, 2024
1 parent e484f93 commit 23d6847
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/preview/__functional/reference_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ struct can_bind_to_reference_helper {
static auto test(int) -> decltype(FUN<T>(std::declval<U&>()), std::true_type{});
template<typename U, typename T>
static auto test(...) -> std::false_type;

template<typename U, typename T>
static auto test_noexcept(int) -> decltype(FUN<T>(std::declval<U&>()), bool_constant<noexcept(FUN<T>(std::declval<U&>()))>{});
template<typename U, typename T>
static auto test_noexcept(...) -> std::false_type;
};

template<typename U, typename T>
struct can_bind_to_reference : decltype(can_bind_to_reference_helper::test<U, T>(0)) {};
template<typename U, typename T>
struct can_bind_to_reference_noexcept : bool_constant<noexcept(can_bind_to_reference_helper::FUN<T>(std::declval<U>()))> {};
struct can_bind_to_reference_noexcept : bool_constant<noexcept(can_bind_to_reference_helper::test_noexcept<U, T>(0))> {};

} // namespace detail

Expand Down

0 comments on commit 23d6847

Please sign in to comment.