Cannot use vector::iterator in rootcint

I cannot use std containers and algorithms in cint interpreter due to iterator operations not functioning (among other problems).
I freshly compiled and installed root 5.22b with gcc 4.3.3 on kubuntu Jaunty, installed to a $ROOTSYS under my home directory.

This is my test macro:

using namespace std;

vector v;

void test1() {
if( v.begin() == v.end() ) { cout<< “A”<<endl; }

void test2() {
for( vector::iterator i=v.begin(); i!=v.end(); ++i ) {
cout<< “B” <<endl;

This is the error:

root [0] .L test.C root [1] test1() Internal error: template function call operator== failed test.C:8: *** Interpreter error recovered *** root [2] test2() Error: operator!= not defined for vector<int,allocator<int> >::iterator test.C:13: *** Interpreter error recovered ***

Could you help with the problem? Thanks in advance.


Can you use v[0] etc?

Cheers, Axel.

Thanks, I could use v[] instead. Perhaps it is due to similar dictionary problems, I’ve also found
etc not working in cint ( “.L mac.C” gives errors ) . Are these fixed in newer release?



that’s a different issue; you will need to generate dictionaries for these types. See e.g. how to create dictionaries for an arbitrary STL class.

Cheers, Axel.