From 97793c700eaa68358d768826a58feee21742ac57 Mon Sep 17 00:00:00 2001 From: Curve Date: Sat, 17 Aug 2024 16:37:52 +0200 Subject: [PATCH] fix: disable `use_bool_op` in objective c (#32) --- include/function2/function2.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/function2/function2.hpp b/include/function2/function2.hpp index ffb82b5..d84ea2d 100644 --- a/include/function2/function2.hpp +++ b/include/function2/function2.hpp @@ -1408,7 +1408,12 @@ struct accepts_all< void_t::value>...>> : std::true_type {}; -#if defined(FU2_HAS_NO_EMPTY_PROPAGATION) +#if defined(__OBJC__) +/// In Objective C lambdas can be implicitly converted to block pointers, +/// thus causing the copy constructor to be invoked. +template +struct use_bool_op : std::false_type {}; +#elif defined(FU2_HAS_NO_EMPTY_PROPAGATION) template struct use_bool_op : std::false_type {}; #elif defined(FU2_HAS_LIMITED_EMPTY_PROPAGATION)