From 21a2a653310a30fbd78dd5875928d274ff2e082c Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Wed, 10 Sep 2025 13:23:50 +1000 Subject: [PATCH] [orc-rt] Host std::decay_t out of helper for orc_rt::bind_front. NFC. The helper implementation shouldn't differ based on how it's initialized. --- orc-rt/include/orc-rt/bind.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/orc-rt/include/orc-rt/bind.h b/orc-rt/include/orc-rt/bind.h index 855873e10db02..2709a9e2adc82 100644 --- a/orc-rt/include/orc-rt/bind.h +++ b/orc-rt/include/orc-rt/bind.h @@ -29,8 +29,10 @@ template class BoundFn { } public: - BoundFn(Fn &&F, BoundArgTs &&...BoundArgs) - : F(std::move(F)), BoundArgs(std::forward(BoundArgs)...) {} + template + BoundFn(FnInit &&F, BoundArgInitTs &&...BoundArgs) + : F(std::forward(F)), + BoundArgs(std::forward(BoundArgs)...) {} template auto operator()(ArgTs &&...Args) { return callExpandingBound(std::index_sequence_for(), @@ -38,16 +40,16 @@ template class BoundFn { } private: - std::decay_t F; - std::tuple...> BoundArgs; + Fn F; + std::tuple BoundArgs; }; } // namespace detail template -detail::BoundFn bind_front(Fn &&F, - BoundArgTs &&...BoundArgs) { - return detail::BoundFn( +detail::BoundFn, std::decay_t...> +bind_front(Fn &&F, BoundArgTs &&...BoundArgs) { + return detail::BoundFn, std::decay_t...>( std::forward(F), std::forward(BoundArgs)...); }