Solved

vector of queues?

Posted on 2002-03-16
3
1,222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

636 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