STL binary search functions

I’m using ROOT 5.15/04 and I’m trying to use the lower_bound and upper_bound functions from the STL library in CINT. Unfortunately I always get the following error message:

Error: Function distance_type(first) is not defined in current scope algo.h(1443)
*** Interpreter error recovered ***

The code looks something like

vector<Double_t> cdf; Double_t U; /* ... fill cdf and U with data ... */ lower_bound(cdf.begin(), cdf.end(), U);

g++ and other compilers don’t report an error with the same code.
Is there something like a workaround for this problem?


Hi Fabian,

We are in the processed on revamping the CINT source code and will be able to work on solving a slew of problems (including yours) when this is done.
In the meantime, please, simply compile your script (using ACLiC).