Solved

vector of queues?

Posted on 2002-03-16
3
1,191 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

930 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

9 Experts available now in Live!

Get 1:1 Help Now