Dear CINT experts,
The following snippet of code leads to trouble.
gROOT->Reset();
#include <vector>
#include <algorithm>
vector<Int_t> a;
a.push_back(2);
a.push_back(1);
cout << "DEBUG before: a = (";
for (size_t i = 0; i != a.size(); ++i) {
cout << a.at(i);
if (i != (a.size()-1))
cout << ", ";
} // for (i)
cout << ")" << endl;
a.sort(a.begin(), a.end());
cout << "DEBUG after : a = (";
for (size_t i = 0; i != a.size(); ++i) {
cout << a.at(i);
if (i != (a.size()-1))
cout << ", ";
} // for (i)
cout << ")" << endl;
}
Running on an Intel Mac, OS X 10.5.2, gcc version 4.0.1 (Apple Inc. build 5465), ROOT built for arch `macosx’.
ROOT v5.18.00@21746 with CINT 5.16.29, Jan 08, 2008 tells me:
root [0]
Processing test_cint_sort.C...
DEBUG before: a = (2, 1)
Internal error: template function call __unguarded_partition failed algo.h:721:
*** Interpreter error recovered ***
ROOT v5.19/03 (trunk@23489) with the same CINT version tells me:
root [0]
Processing test_cint_sort.C...
DEBUG before: a = (2, 1)
Error: operator- not defined for vector<int,allocator<int> >::iterator algo.h:722:
This puzzles me. How do I get two different errors with the same CINT version? And how should I sort this vector?
Thanks,
Jeroen