0

I'm noob but as i know it doesnt matter what's data type container contains. So here is what i'm trying to do:

std::deque<list<U32> > ReqLis; 

And result of it is next:

error: ISO C++ forbids declaration of 'deque' with no type error: invalid use of '::' expected ';' before '<' token 

But when instead of it i try to do this:

std::list<list<U32> > ReqList; 

That's ok..................

Question is am i such great noob or is it compiler fail? I'm using gcc/g++

4
  • 7
    did you #include <deque> ? Commented Oct 18, 2013 at 6:30
  • 1
    you shouldn't use U32, but better std::uint32_t. Commented Oct 18, 2013 at 6:32
  • std::deque<std::list<U32> > ? Commented Oct 18, 2013 at 9:24
  • Sorry, i think i'm total noob. I really forgot to include it and dont bother yourself with U32 it's ok Commented Oct 18, 2013 at 11:06

3 Answers 3

3

Could you list all the code? The usage of namespaces in your code a bit loose.

The deque in a separate header cpp reference

#include <deque> 
Sign up to request clarification or add additional context in comments.

Comments

3

There is no standard type called U32, but if you #include (stdint.h for C) you can use std::uint32_t1, a 32 bit unsigned integer, which is (I assume) what you want.

first you should include this header file for user u32

 #include <cstdint> std::deque<std::list<std::uint32_t>> ReqList; 

Comments

2

Add following :

#include <list> #include<deque> #include<stdint.h> std::deque<uint32_t> ReqList; #include<deque> is for deque data type #include<list> is for list data type #include<stdint.h> is for uint32_t (Integer type with a width of exactly 8, 16, 32, or 64 bits.For signed types, negative values are represented using 2's complement. 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.