I want to create a list of queues in C++ but the compiler gives me some cryptic messages:
#include <list>
#include <queue>
class Test
{
[...]
list<queue> list_queue;
[...]
}
Output:
error C2143: syntax error : missing ';' before '<'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2238: unexpected token(s) preceding ';'
It gives me the same error even if I use int as the template paramenter. What's going on?
(btw, I'm using VC++ 2008 EE)
queue
is a template class as well, so you'll need to specify the element type contained in your queues. Also, -
is not a legal identifier character in C++; perhaps you meant _
?
std::list<std::queue<SOME_TYPE_HERE> > list_queue;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With