Hi Akira,
it should work now in the trunk. Thanks for your report!
Cheers, Axel.
OKUMURA, Akira wrote on 06/29/2010 05:21 PM:
> Hello Wim and Axel,
>
> Kevin kindly told me that vector<bool> is a special template in the C++ standard and thus it is different from other vectors such as vector<int>... I did not know this in fact.
>
>> I don't have a solution for you, but perhaps it will help out. >> std::vector<bool> is NOT a directly indexable container ... in fact, the >> standard specifies std::vector<bool> as a specialization with different >> semantics that the base std::vector<T> template. It can't be directly >> indexed or iterated; it requires proxy objects. >> >> See, for instance, http://www.gotw.ca/gotw/050.htm and >> http://www.gotw.ca/publications/N1211.pdf
>> Tim, >> >>> It doesn't, well __getitem__() is missing: >> >> hmm, something with the dictionary than. I'm afraid we'll have to wait >> until Axel wakes up, as the problem is there in CINT also: >> >> [pc3-wlav] ~/rootdev/root % root -b -l >> root [0] #include <vector> root [1] std::vector<bool> v; root [2] v.push_back(false); root [3] v.push_back(true); root [4] std::cout << v.size() << std::endl; >> 2 >> root [5] std::cout << v[0] << std::endl; Error: Can't call vector<bool,allocator<bool> >::operator[]((int)0) in current scope (tmpfile):1: >> Possible candidates are... >> (in vector<bool,allocator<bool> >) >> *** Interpreter error recovered *** >> root [6] >> >>> How do you get a dictionary to be loaded and why do the others get >>> loaded automagically? >> >> Long story. In short: some std::vector instantiations are "shipped" with >> CINT, others are auto-generated, yet others are found through the ROOTMAP >> or LDPATH search paths if e.g. setup within an experiment runtime. >> >> Best regards, >> Wim >> -- >> WLavrijsen_at_lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
This archive was generated by hypermail 2.2.0 : Wed Jun 30 2010 - 17:50:01 CEST