Error with STL random_shuffle()

Hi,

I am trying to use the STL random_shuffle() function within CINT. I keep getting this error:

Processing shuffle_test.cpp…
Error: Function distance_type(first) is not defined in current scope algo.h(537
)
*** Interpreter error recovered ***

This code works fine outside of ROOT e.g. in VisualC++.
Here is the code:

#include
#include
#include
using namespace std;
vector vi;
int shuffle_test(void)
{
for (int i = 0; i < 100; i++)
{
vi.push_back(i);
}
random_shuffle(vi.begin(), vi.end());// shuffle elements
for (int i = 0; i < 100; i++)
{
cout<<vi[i]<<endl;
}
return 0;
}

Hi,

just to let you know: I’m working on solving this. It’s much more complex than it seems - so I’m not there yet. I’ll let you know once it’s working.

Axel.

Hi,

sorry for making you wait so long. This should now be fixed in CINT’s CVS. Thanks for reporting it!

Cheers, Axel.

Hey,

Thanks for taking care of this.

Anuj