@@ -481,17 +481,17 @@ template
481481>
482482struct InputPack
483483{
484- std::tuple<RSignal<D, TValues> ...> Data;
484+ std::tuple<const RSignal<D, TValues>& ...> Data;
485485
486486 template <typename TFirstValue, typename TSecondValue>
487487 InputPack (const RSignal<D,TFirstValue>& first, const RSignal<D,TSecondValue>& second) :
488- Data (std::make_tuple (first, second))
488+ Data (std::tie (first, second))
489489 {
490490 }
491491
492492 template <typename ... TCurValues, typename TAppendValue>
493493 InputPack (const InputPack<D, TCurValues ...>& curArgs, const RSignal<D,TAppendValue>& newArg) :
494- Data (std::tuple_cat(curArgs.Data, std::make_tuple (newArg)))
494+ Data (std::tuple_cat(curArgs.Data, std::tie (newArg)))
495495 {
496496 }
497497};
@@ -533,15 +533,15 @@ REACT_IMPL_BEGIN
533533template
534534<
535535 typename D,
536- typename TFunc ,
536+ typename F ,
537537 typename ... TValues
538538>
539539struct ApplyHelper
540540{
541- static inline auto MakeSignal (const TFunc & func, const RSignal<D,TValues>& ... args)
542- -> decltype(D::MakeSignal(func, args ...))
541+ static inline auto MakeSignal (F& & func, const RSignal<D,TValues>& ... args)
542+ -> decltype(D::MakeSignal(std::forward<F>( func) , args ...))
543543 {
544- return D::MakeSignal (func, args ...);
544+ return D::MakeSignal (std::forward<F>( func) , args ...);
545545 }
546546};
547547
@@ -550,34 +550,34 @@ REACT_IMPL_END
550550REACT_BEGIN
551551
552552// //////////////////////////////////////////////////////////////////////////////////////
553- // / operator>>= overload to connect inputs to a function and return the resulting node.
553+ // / operator->* overload to connect inputs to a function and return the resulting node.
554554// //////////////////////////////////////////////////////////////////////////////////////
555555// Single input
556556template
557557<
558558 typename D,
559- typename TFunc ,
559+ typename F ,
560560 typename TValue
561561>
562- inline auto operator >>= (const RSignal<D,TValue>& inputNode, TFunc func)
563- -> decltype (D::MakeSignal(func, inputNode))
562+ inline auto operator ->* (const RSignal<D,TValue>& inputNode, F&& func)
563+ -> decltype (D::MakeSignal(std::forward<F>( func) , inputNode))
564564{
565- return D::MakeSignal (func, inputNode);
565+ return D::MakeSignal (std::forward<F>( func) , inputNode);
566566}
567567
568568// Multiple inputs
569569template
570570<
571571 typename D,
572- typename TFunc ,
572+ typename F ,
573573 typename ... TValues
574574>
575- inline auto operator >>=( InputPack<D,TValues ...>& inputPack, TFunc func)
576- -> decltype (apply(REACT_IMPL::ApplyHelper<D, TFunc , TValues ...>
577- ::MakeSignal, std::tuple_cat(std::make_tuple( func), inputPack.Data)))
575+ inline auto operator ->*( const InputPack<D,TValues ...>& inputPack, F&& func)
576+ -> decltype (apply(REACT_IMPL::ApplyHelper<D, F&& , TValues ...>
577+ ::MakeSignal, std::tuple_cat(std::forward_as_tuple(std::forward<F>( func) ), inputPack.Data)))
578578{
579- return apply (REACT_IMPL::ApplyHelper<D, TFunc , TValues ...>
580- ::MakeSignal, std::tuple_cat (std::make_tuple ( func), inputPack.Data ));
579+ return apply (REACT_IMPL::ApplyHelper<D, F&& , TValues ...>
580+ ::MakeSignal, std::tuple_cat (std::forward_as_tuple (std::forward<F>( func) ), inputPack.Data ));
581581}
582582
583583// //////////////////////////////////////////////////////////////////////////////////////
0 commit comments