STL and "function try blocks"
- From: "Babak Pourat" <pourat@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 23 Feb 2006 18:59:52 +0100
Hallo
the following code does not compile (VC 7.1):
#include <vector>
int testTry() try{
std::vector<int> *x = new std::vector<int>;
delete x;
return 0;
}catch (...) {
return 0;
}
int main(){
return 0;
}
d:\tmp\trytst\trytst\trytst.cpp(11) : warning C4091: '' : ignored on left of
'int' when no variable is declared
d:\tmp\trytst\trytst\trytst.cpp(11) : error C2143: syntax error : missing
';' before 'inline function header'
Does any one understand why it compiles if I delete the "delete x;"
statement?
thanks
Babak
.
- Follow-Ups:
- Re: STL and "function try blocks"
- From: mzdude
- Re: STL and "function try blocks"
- From: mzdude
- Re: STL and "function try blocks"
- From: Heinz Ozwirk
- Re: STL and "function try blocks"
- From: Brian Muth
- Re: STL and "function try blocks"
- Prev by Date: Re: help! anyone knows how to improve STL multi-thread synch?
- Next by Date: Re: STL and "function try blocks"
- Previous by thread: Replace a vector with a list
- Next by thread: Re: STL and "function try blocks"
- Index(es):
Relevant Pages
|