Bug in rootcint (wrong stl syntax?)

Dear rooters,
I think I found a bug in rootcint related to the syntax of stl containers.

(Im’ using root 4.04/02b)

Here is the code of the header file:

#include <TObject.h>
using namespace std ;
typedef map<string, map<string, double> > defaultsMap ;
class Parameters : public TObject
Parameters(void) ;
~Parameters(void) {;}
void setDefaults(defaultsMap &) ;
defaultsMap & getDefaults(void) ;

defaultsMap defaults ;
int dimension ;
} ;

When I invoke rootcint, I get the following error

rootcint parametersDict.C -c Parameters.h
[color=darkred]Compiling dictionary
g++ -c -o parametersDict.o parametersDict.C root-config --cflags
parametersDict.C: In member function virtual void Parameters::Streamer(TBuffer&)': parametersDict.C:126: error:>>’ should be `> >’ in template class name
make: *** [parametersDict.o] Error 1

The reason appears to be a wrong syntax of stl containers:
the offending statement is

[color=red]std::pair<Value_t const, map<string,double,less,allocator<pair<const string,double> > >> R__t3(R__t,R__t2);[/color]

where the correct syntax should instead be:

[color=red]std::pair<Value_t const, map<string,double,less,allocator<pair<const string,double> > > > R__t3(R__t,R__t2);[/color]

(the closing >>> brackets of a container should always be interspersed with blanks, I guess).
Fixing this by hand in parametersDict.C allows me to succesfully produce my working executable.

Any suggestions?

Best regards, Dario


The problem has been fixed in CVS.

Note that the way you are generating the dictionary imply that you are using the (old) streamer function based I/O which less functional and performant that the TStreamerInfo based I/O.

To use the new style I/O (and also solve your problem without upgrading to a new version of ROOT), simply add at the end of your header file:#ifdef __MAKECINT__ #pragma link C++ class Parameters+; #endif
or call rootcint parametersDict.C -c Parameters.h+