Re: std::map and root

From: Marc Escalier <escalier_at_lal.in2p3.fr>
Date: Sun, 13 Nov 2011 11:52:31 +0100


thanks Seb and Benjamin

a remaining question if you would have time :

root [3] std::map<std::string,TH1*>::const_iterator hiter=hmap.begin()
root [4] std::map<std::string,TH1*>::const_iterator theend=hmap.end()
root [5] if (hiter!=theend) cout << "not the end yet" << endl;

Error: operator!= not defined for
map<string,TH1*,less<string>,allocator<pair<const string,TH1*> > >::iterator (tmpfile):1: *** Interpreter error recovered ***

i thought that this third instruction was perfectly legal

how to circumvent this ?




  On Sun, 13 Nov 2011, Sebastien Binet wrote:

> Marc,
>
> note that if you were using the recommanded Athena release (17.0.5)
> you'd get the dictionary for this template instantiation:
>
> $ asetup 17.0.5
> $ checkPlugins.py --dump-content | grep "^map"
> [...]
> map<long,void*>:
> map<string,CaloRec::Arrayrep>:
> map<string,HepGeom::Transform3D>:
> map<string,RooDataHist*>:
> map<string,RooDataSet*>:
> map<string,TH1*>:
> map<string,bool>:
> map<string,double>:
> map<string,float>:
> map<string,int>:
> map<string,int>::iterator:
> map<string,long>:
> [...]
>
> -s
>
>
> On Sun, Nov 13, 2011 at 11:31 AM, Marc Escalier <escalier_at_lal.in2p3.fr> wrote:
>> thank you Benjamin
>>
>> ===============
>> ===============
>> ===============
>>
>> On Sat, 12 Nov 2011, Benjamin Bannier wrote:
>>
>>> Hi Marc,
>>>
>>>> just wondering if you would have an idea on this :
>>>>
>>>> std::map<string,TH1*> hmap;
>>>> std::map<std::string,TH1*>::const_iterator hiter(hmap.begin());
>>>>
>>>> -->Error: Can't call iterator::iterator(hmap.begin()) in current scope
>>>
>>> not that have any idea what happens here, but this seems fine in
>>> 5.30.03:
>>>
>>>   std::map<string,TH1*> hmap;
>>>   std::map<std::string,TH1*>::const_iterator hiter = hmap.begin();
>>>
>>> Welcome to CINT.
>>>
>>> Benjamin
>>>
>>>
>>> --
>>> "Good judgment comes from experience. Experience comes from bad judgment."
>>>
>>
>>
>
Received on Sun Nov 13 2011 - 11:52:40 CET

This archive was generated by hypermail 2.2.0 : Sun Nov 13 2011 - 17:50:01 CET