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:
[color=darkred][b]______________________________________________________________________
#include <TObject.h>
#include
#include
using namespace std ;
typedef map<string, map<string, double> > defaultsMap ;
//===================================================================
class Parameters : public TObject
{
public:
Parameters(void) ;
~Parameters(void) {;}
void setDefaults(defaultsMap &) ;
defaultsMap & getDefaults(void) ;
private:
defaultsMap defaults ;
int dimension ;
ClassDef(Parameters,1)
} ;
[/b][/color]
When I invoke rootcint, I get the following error
[color=darkred]______________________________________________________________________
rootcint parametersDict.C -c Parameters.h[/color]
[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[/color]
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