Re: std::vector<Bool_t> in PyROOT

From: <wlavrijsen_at_lbl.gov>
Date: Mon, 28 Jun 2010 21:41:40 -0700


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
Received on Tue Jun 29 2010 - 06:42:01 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 29 2010 - 17:50:01 CEST