#ifndef TMVA_RINFERENCEUTILS #define TMVA_RINFERENCEUTILS #include // std::forward, std::index_sequence namespace TMVA { namespace Experimental { namespace Internal { /// Compute helper template class ComputeHelper; template class ComputeHelper, T, F> { template using AlwaysT = T; F fFunc; public: ComputeHelper(F &&f) : fFunc(std::forward(f)) {} auto operator()(AlwaysT... args) -> decltype(fFunc.Compute({args...})) { return fFunc.Compute({args...}); } }; } // namespace Internal /// Helper to pass TMVA model to RDataFrame.Define nodes template auto Compute(F &&f) -> Internal::ComputeHelper, T, F> { return Internal::ComputeHelper, T, F>(std::forward(f)); } } // namespace Experimental } // namespace TMVA #endif // TMVA_RINFERENCEUTILS