Hi Ivana,
This is a problem in rootcint. It should be fixed shortly.
Cheers,
Philippe.
-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Ivana Hrivnacova
Sent: Wednesday, April 24, 2002 9:40 AM
To: RootTalk
Cc: David GUEZ
Subject: [ROOT] std::map with std::pair key
Hi,
We have a problem with compiling
dictionary for the class like the following:
MyClass.h:
------------
#ifndef MYCLASS_H
#define MYCLASS_H
#include <map>
#include <TObject.h>
class MyClass : public TObject
{
public:
typedef std::pair<Int_t, Int_t> MyPair;
typedef std::map<MyPair, Double_t> MyMap;
MyClass();
virtual ~MyClass();
private:
// data members
MyMap fMap; //
ClassDef(MyClass,1) //Motif
};
#endif //MyClass_H
We declare it in LinkDef in a standard way as:
#pragma link C++ class MyClass+;
The compiler complains for some "unknown" variable:
Compiling TtestCint.cxx ...
src/TtestCint.cxx: In function `void R__MyClass_fMap(TBuffer &, void *,
int)':
src/TtestCint.cxx:35: `unknown' undeclared (first use this function)
src/TtestCint.cxx:35: (Each undeclared identifier is reported only once
src/TtestCint.cxx:35: for each function it appears in.)
src/TtestCint.cxx:35: parse error before `;'
which really appears in the generated dictionary.
Is there some work around for this
(besides implementing the pair class ourselves)?
Best regards,
Ivana
P.S. We have Root version 3.03/03.
==============================================================
e-mail: Ivana.Hrivnacova@cern.ch
address: Institut Physique Nucleaire, 91406 Orsay, France
phone: (33) 01 69 15 65 94
==============================================================
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:51 MET