Thanks up-front to @Niklas_Nolte for helping me understand the problem so far!
I use a lambda in RDataFrame::ForeachSlot successfully to process specified columns in my dataset.
auto myfunc n= [](Double_t vOpt, Double_t v1, Double_t v2) { < do stuff > };
d.ForeachSlot( myfunc , { "varOpt", "var1", "var2" } );
Now some columns that are only present in certain datasets and the rest that are always present. Since the tasks that involve the always-present and sometimes-present columns are independent, I figured I could have a single lambda that processes the always-present columns and a âwrapperâ lambda that can be passed to the ForeachSlot when I know the extra columns will be present.
auto myfunc1 = [](Double_t v1, Double_t v2) { < do stuff > };
auto myfunc2 = [&myfunc1](Double_t vOpt, auto... args) { myfunc1(&args...);};
d.ForeachSlot( myfunc2 , { "var3", "var1", "var2" } );
This avoids specifying all the arguments at multiple steps when all I want myfunc2 to do is pass stuff through to myfunc1.
However, this fails when passed to the ForeachSlot because of the âautoâŚâ that I use to specify the pack in the lambda, thanks to some type checks that ROOT does in TypeTraits.hxx on lines 30-44: ROOT: core/foundation/inc/ROOT/TypeTraits.hxx Source File
ROOT concludes that the lambda is not callable because auto⌠is not resolved.
You can see an example of a template lambda that should work fine, and the failure that is triggered by ROOTâs type checks here: (prepared by @Niklas_Nolte )
Help?
ROOT Version: 6.24.06
Platform: x86-645 (conda on arch)
Compiler: gcc 11.2.0