RE: [ROOT] vector::iterator in an STL vector my own class

From: Philippe Canal (pcanal@fnal.gov)
Date: Tue Feb 17 2004 - 20:00:35 MET


Hi,

You need to generate the dictionary for the iterator:

	#pragma link C++ nestedclass;	
	#pragma link C++ vector<MyClass>::iterator;

Cheers,
Philippe. 

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of John Pretz
Sent: Monday, February 16, 2004 10:56 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] vector::iterator in an STL vector my own class


Howdy ROOTTALK!!!

Apologies if this is in the documentation or on the mailing lists.  I just 
can't find it.

I have a class (ClassA in this example) of my own that I'd like to put 
into an STL vector and iterate over it using vector::iterator.  I'd really 
like to do this from the command line, if possible.

In this example, I fill up an STL vector<ClassA> with some data.  If I get 
it out using the vector's 'array syntax' all is well.  But if I try the 
vector::iterator syntax, I'm hosed.

I'm using root 3.10.01 on a redhat 9 machine.  gcc 3.2.

The attached code should show off all my problems.  'make' will compile 
the code and run the test.

Thanks for looking,

John
-- 
---------------Visit my webpage!---------------------
---------http://umdgrb.umd.edu/pretz-----------------



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET