Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vector in C++

Status
Not open for further replies.

LaoMa

Programmer
Aug 24, 2002
10
US
Now I need to implement a variable-sized generic QueueArray class that implements an array of queues,and then constructs a QueueArray object intqueue consisting of an array of 10 integer queues using the statement:

QueueArray <int> intqueue (10);

I tried this:
template<class T>
class QueueArray
{
public:
....(functions)
private:
queue<T> que;
...
}

Now I wonder how to make a vector or list,which holds an array of queues of type T?
Any help is appreciated.

 
Any STL vector or list would have to be created with a specific type, which means that you couldn't have a list/vector of QueueArrays of arbitrary type. You could always do:
Code:
vector <QueueArray <int> > int_qa_vector;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top