Solved

vector of queues?

Posted on 2002-03-16
3
1,184 Views
Last Modified: 2013-12-14
I'd like to have a vector of queues in my program but my compiler ( Microsoft Visual C++ 6.0 ) isn't allowing it.  What is wrong with this syntax?

void sysGen(vector<queue<int>>, vector<queue<int>>,
         vector<queue<int>>);
0
Comment
Question by:abstractionz
  • 2
3 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6872030
The problem is ">>" - the compiler mistakenly interprets that as the right-shift operator ("max-munch"). make your code read

void sysGen(vector<queue<int> >, vector<queue<int> >,
        vector<queue<int> >);  // note the spaces!

0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 6872039
Oh, or you could also

typedef queue<int> int_queue;

void sysGen(vector<int_queue>, vector<int_queue>,
        vector<int_queue>);

or

typedef queue<int> int_queue;
typedef vector<int_queue> vector_of_int_queues;

void sysGen(vector_of_int_queues, vector_of_int_queues,
        vector_of_int_queues);



0
 

Author Comment

by:abstractionz
ID: 6872046
thanks a lot.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now