RE:Re: [ROOT] cint5.14.84

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Mon Apr 23 2001 - 16:41:09 MEST


Hello Prasad,

It is good hear that Philippe gave you a solution. 
I looked into it a little closer and found root cause of it.

The reason why you had problem with map<string,ResiduePara> was
lack of operator==, !=, <, >, <=, >= function.

   bool operator==(const ResiduePara& a,const ResiduePara& b);
   bool operator!=(const ResiduePara& a,const ResiduePara& b);
                <
                >
                <=
                >=

map<string,ResiduePara> has operator==, !=, <, >, <=, >= functions.
bool operator==(const map<string,ResiduePara>& a,const map<string......
In those functions operator==,!=,<,>,<=,>= for ResiduePara is used.
So, if you use any of those operator functions for map<string,ResiduePara>,
the compiler will complain about missing operator== for ResiduePara. 

You may still wonder why g++ does not complain about this. Because
you do not use any of those operator functions in your source code.
However, in Cint dictionary, evey existing functions are called including
above operator functions. So, the dictionary reveals the hidden problem.
Adding '#pragma link off all functions;' , you avoid using those operator
functions in the dictionary  and problem goes away.


So, to be precise,  solution will be either

  1) Add '#pragma link off all functions;'
             OR
  2) Define operator==, !=, <, >, <=, >= for ResiduePara
             OR
  3) Use map<string,ResiduePara*> as I suggested before


Thank you
Masaharu Goto


>Date: Sun, 22 Apr 2001 11:04:04 +0400 (RET)
>From: "B.V.L.S.Prasad" <shiva@mbu.iisc.ernet.in>
>To: Masaharu Goto <MXJ02154@nifty.ne.jp>
>Cc: roottalk@pcroot.cern.ch, rootdev@pcroot.cern.ch
>Subject: Re: [ROOT] cint5.14.84
>
>Hello all,
>       Phileppe Canal has given me a suggestion for 
>map<string, ResiduePara> problem: and it worked without any
>further problem:
>
>the solution is :
>
>add a LinkDef.h file with following content:
>
>#ifdef __CINT__
>#pragma link off all globals;
>#pragma link off all classes;
>#pragma link off all functions;
> 
>#pragma link C++ class ResiduePara;
>#endif
>
>Only after this workaround/fix, I came to know about #pragma use...
>
>Does it need a fix or this LinkDef.h is enough ?
>
>thankyou for all the help.
>
>prasad.
>
>On Sun, 22 Apr 2001, Masaharu Goto wrote:
>
>> Hello Rooters,
>> 
>> I'll copy cint5.14.84 to CERN from now.  Most of the
>> reported problems are fixed, however, a couple of them
>> are still open.  They are
>>   1. temporal object deletion timing in optimized function
>>   2. Problem with map<string,ResiduePara>
>> 
>> Thank you
>> Masaharu Goto
>> 
>
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:43 MET