K
KRUNOPOPOVIC
Hello,
This code give me "deque empty before pop" error
with visual c++ express in debug configuration mode.
Why poping empty stack doesn't throw exception ?
Uncommenting the line solves the problem.
Kruno
#include<iostream>
#include<stack>
using namespace std;
int main()
{
stack<int> s ;
try
{
//if (s.empty()) throw "something";
s.pop();
}
catch(...)
{
cout<< "hello empty stack" << endl;
}
return 0;
}
This code give me "deque empty before pop" error
with visual c++ express in debug configuration mode.
Why poping empty stack doesn't throw exception ?
Uncommenting the line solves the problem.
Kruno
#include<iostream>
#include<stack>
using namespace std;
int main()
{
stack<int> s ;
try
{
//if (s.empty()) throw "something";
s.pop();
}
catch(...)
{
cout<< "hello empty stack" << endl;
}
return 0;
}