diff --git a/src/rpp/rpp/observables/observable.hpp b/src/rpp/rpp/observables/observable.hpp index a0a0daea7..19bc89521 100644 --- a/src/rpp/rpp/observables/observable.hpp +++ b/src/rpp/rpp/observables/observable.hpp @@ -339,7 +339,8 @@ namespace rpp if constexpr (requires { typename std::decay_t::template operator_traits; }) { using result_type = typename std::decay_t::template operator_traits::result_type; - return observable, Strategy>>{std::forward(op), std::move(m_strategy)}; + if constexpr (requires { typename std::decay_t::template operator_traits::result_type; }) // narrow compilataion error a bit + return observable, Strategy>>{std::forward(op), std::move(m_strategy)}; } else { diff --git a/src/rpp/rpp/operators/finally.hpp b/src/rpp/rpp/operators/finally.hpp index 88102784a..42c4c424b 100644 --- a/src/rpp/rpp/operators/finally.hpp +++ b/src/rpp/rpp/operators/finally.hpp @@ -53,7 +53,7 @@ namespace rpp::operators * @ingroup utility_operators * @see https://reactivex.io/documentation/operators/do.html */ - template LastFn> + template auto finally(LastFn&& last_fn) { return details::finally_t>{std::forward(last_fn)}; diff --git a/src/rpp/rpp/operators/fwd.hpp b/src/rpp/rpp/operators/fwd.hpp index 131f04036..5f3b591f6 100644 --- a/src/rpp/rpp/operators/fwd.hpp +++ b/src/rpp/rpp/operators/fwd.hpp @@ -53,7 +53,7 @@ namespace rpp::operators requires (!utils::is_not_template_callable || std::same_as>) auto filter(Fn&& predicate); - template LastFn> + template auto finally(LastFn&& lastFn); template @@ -79,10 +79,6 @@ namespace rpp::operators template typename Subject = rpp::subjects::publish_subject> auto multicast(); - template - requires (!utils::is_not_template_callable || rpp::constraint::observable>) - auto flat_map(Fn&& callable); - template requires constraint::observables_of_same_type, std::decay_t...> auto merge_with(TObservable&& observable, TObservables&&... observables); diff --git a/src/rpp/rpp/operators/group_by.hpp b/src/rpp/rpp/operators/group_by.hpp index 4e1d8d1fc..5aa4e0210 100644 --- a/src/rpp/rpp/operators/group_by.hpp +++ b/src/rpp/rpp/operators/group_by.hpp @@ -166,8 +166,8 @@ namespace rpp::operators::details template struct operator_traits { - static_assert(std::invocable, "KeySelector is not invocacble with T"); - static_assert(std::invocable, "ValueSelector is not invocable with T"); + static_assert(!std::same_as>, "KeySelector is not invocacble with T"); + static_assert(!std::same_as>, "ValueSelector is not invocable with T"); static_assert(std::strict_weak_order, rpp::utils::decayed_invoke_result_t>, "KeyComparator is not invocable with result of KeySelector"); using result_type = grouped_observable, rpp::utils::decayed_invoke_result_t, group_by_observable_strategy>>; diff --git a/src/rpp/rpp/operators/map.hpp b/src/rpp/rpp/operators/map.hpp index 74e3fad4d..43ec6d0d1 100644 --- a/src/rpp/rpp/operators/map.hpp +++ b/src/rpp/rpp/operators/map.hpp @@ -50,7 +50,7 @@ namespace rpp::operators::details template struct operator_traits { - static_assert(std::invocable, "Fn is not invocable with T"); + static_assert(!std::same_as>, "Fn is not invocable with T"); using result_type = std::invoke_result_t; diff --git a/src/rpp/rpp/utils/constraints.hpp b/src/rpp/rpp/utils/constraints.hpp index 87e9d5792..8a47e751a 100644 --- a/src/rpp/rpp/utils/constraints.hpp +++ b/src/rpp/rpp/utils/constraints.hpp @@ -31,7 +31,7 @@ namespace rpp::constraint concept variadic_decayed_same_as = sizeof...(Types) == 1 && (decayed_same_as && ...); template - concept static_pointer_convertible_to = requires { static_cast(std::declval()); }; + concept static_pointer_convertible_to = requires(T* ptr) { static_cast(ptr); }; template concept iterable = requires(R& rng) {