Hello Martin, I bet you do not install cintdlls with ROOT. Compiled version has vector<T>::clear() but interpreted version does not. Please install cintdll and see what will happen. I'll add clear() function for the interpreted version in next release. Thank you Masaharu Goto ----- Original Message ----- From: "Rene Brun" <Rene.Brun@cern.ch> To: <cint@pcroot.cern.ch> Sent: Saturday, October 05, 2002 4:32 AM Subject: [CINT] [ROOT] using std::vector<> with CINT (fwd) > > > ---------- Forwarded message ---------- > Date: Fri, 4 Oct 2002 19:47:53 +0100 (BST) > From: Martin Turner <martin@hep.ph.liv.ac.uk> > To: roottalk@pcroot.cerm.ch > Cc: roottalk@pcroot.cern.ch > Subject: [ROOT] using std::vector<> with CINT > > Hello root people. > When wanting to use a template vector with CINT some standard funtions > work and some don't. For example v.clear() is not in current scope. > How do I obtain the full std library? or do I have to live with it? Or am > I doing something stupid? > > The following code breaks at v.clear(); > Is there an alternative to clear() that will work in a root session? > { > using namespace std; > #include <vector> > > std::vector<int> v(0); > v.reserve(10); > > v.push_back(34); > v.push_back(24); > cout<<"element 3 ="<<v[1]<<endl; > > v.clear(); > //cout<<"new 3rd element ="<<v[1]<<endl; > > } > > Thanks Martin >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:12 MET