RE: [ROOT] stl map::const_iterator - CINT buglet?

From: Axel Naumann (axel@fnal.gov)
Date: Thu Jun 14 2001 - 18:40:31 MEST


Hi,

it's in CInt, so I guess it must have made its way into Root...

Cheers, Axel.

> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
> [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Phil Adamson
> Sent: Thursday, June 14, 2001 11:10 AM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] stl map::const_iterator - CINT buglet?
> 
> 
> Hi Rene, Masa
> 
> Root 3.00/06
> 
> I have in a class 
> 
> std::map<Int_t,PulserSummary>::const_iterator GetBegin() const;
> 
> rootcint generates for this 
> 
> static int G__PulserSummaryList_GetBegin_5_1(G__value *result7,G__CONST
> char *funcname,struct G__param *libp,int hash) {
>       {
> const         map<int, PulserSummary,less<int>,__malloc_alloc_template<0>
> >::iterator *pobj,xobj=((const
> PulserSummaryList*)(G__getstructoffset()))->GetBegin();
>         pobj=new
> map<int,PulserSummary,less<int>,__malloc_alloc_template<0>
> >::iterator(xobj);
>         result7->obj.i=(long)((void*)pobj); result7->ref=result7->obj.i;
>         G__store_tempobject(*result7);
>       }
>    return(1 || funcname || hash || result7 || libp) ;
> }
> 
> I think it should have const_iterator rather than iterator. Is this fixed
> in 3.01?
> 
> 	Phil
> 
> 

attached mail follows:


Hello Alex, Thank you for reporting this problem. I'll fix this in cint5.14.85. Masaharu Goto >Date: Mon, 23 Apr 2001 16:45:35 -0500 >From: Axel Naumann <axel@fnal.gov> >To: Masaharu Goto <MXJ02154@nifty.ne.jp> >Subject: CINT: method returning std::const_iterator > >Dear Masaharu, > >I have a method >std::list<TObjectDerived>::const_iterator TSomeClass::GetBegin() const >{return _memberList.begin();} > >Running rootcint over TSomeClass yields a > >static int G__TSomeClass_GetBegin_5_0(G__value *result7,G__CONST char >*funcname,struct G__param *libp,int hash) { > { >const list<TObjectDerived,allocator<TObjectDerived> >::iterator >*pobj,xobj=((const TSomeClass*)(G__getstructoffset()))->GetBegin(); > pobj=new list<TObjectDerived,allocator<TObjectDerived> >>::iterator(xobj); > result7->obj.i=(long)((void*)pobj); result7->ref=result7->obj.i; > G__store_tempobject(*result7); > } > return(1 || funcname || hash || result7 || libp) ; >} > >which results in a >error C2440: 'initializing' : cannot convert from 'class std::list<class >TObjectDerived,class std::allocator<class TObjectDerived> >::const_iterator' >to 'class > std::list<class TObjectDerived,class std::allocator<class TObjectDerived> >>::iterator' > >So apparently CINT transforms a std::const_iterator into an std::iterator. >(Root 3.06, MS VC 6.0, Win NT) > >Could you fix this? > >Best regards, Axel. >



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