Details
-
Bug
-
Status: Open (View Workflow)
-
Low
-
Resolution: Unresolved
-
6.12/00, 6.13/01, 6.14/00, 6.15/01, 6.18/00
-
None
-
None
-
ROOT Version: 6.10, 6.18
Platform: CC7
Compiler: gcc 4.8.5
Description
Dear rooters,
It seems that TF1 does not admit a "std::bind" as argument since v6.10. The following code works in 6.10, but not in newer versions,
originalFF = [](double *x , double *par){ (void)par; return *x; }; // original function; it can be a functor, a proper function, a lambda... |
boundFF = std::bind (originalFF,std::placeholders::_1, std::placeholders::_2);
|
TF1 myFitFunct("myFitFunct", boundFF,0, 1 , 0 ) |
It seems TF1 still admits lambda functions as arguments; this example works also in newer versions
originalFF = [](double *x , double *par){ (void)par; return *x; }; |
boundFF = std::bind (originalFF,std::placeholders::_1, std::placeholders::_2);
|
intermediateFF = [](double *x , double *par){ return boundFF(x, par); } // extra step in order to use std::bind with TF1 |
TF1 myFitFunct("myFitFunct", intermediateFF,0, 1 , 0 ) |
OP: https://root-forum.cern.ch/t/std-bind-wrapped-by-tf1-is-not-supported-since-6-10/35466
Thank you for your time.
Regards,
atd