Pop from queue

Hi,
I want pop from queue an asign value in one container.
What i do?
Thank you
 
int a = q1.pop(); // error 
1
2
int a = q1.top();
q1.pop();
The top function don't exist.
2 IntelliSense: class "std::queue<int, std::deque<int, std::allocator<int>>>" has no member "top" c:\Users\red\Documents\Visual Studio 2012\Projects\test\test\Source.cpp 39 16 test

Error 1 error C2039: 'top' : is not a member of 'std::queue<_Ty>' c:\users\irblu_000\documents\visual studio 2012\projects\test\test\source.cpp 39 1 test
Last edited on
Oh, I thought you have a stack... in that case use front() instead.
Topic archived. No new replies allowed.