D
Diego Martins
I just discovered a serious issue when compiling code using auto_ptr<>
and VC 8.0
consider some sort of create() function
blahblah * create() { return new blahblah; }
and a pretty auto_ptr
auto_ptr<base_blahblah> p;
int main() {
....
p.reset(create());
// use p as usual and we will be free of leak
}
but if we change that line to
p = create();
the WILL compile on VC 8 and may raise an access violation exception
You can tell me to disable these damned extensions and stop
bothering....
Oww, how I wish.. Of course I can't disable them because many Windows
headers depend on this feature enabled :-(
Is there any practical way to get rid of this? It makes easier to ruin
a program by accident...
What a damned extension heh?
thanks
Diego Martins
and VC 8.0
consider some sort of create() function
blahblah * create() { return new blahblah; }
and a pretty auto_ptr
auto_ptr<base_blahblah> p;
int main() {
....
p.reset(create());
// use p as usual and we will be free of leak
}
but if we change that line to
p = create();
the WILL compile on VC 8 and may raise an access violation exception
You can tell me to disable these damned extensions and stop
bothering....
Oww, how I wish.. Of course I can't disable them because many Windows
headers depend on this feature enabled :-(
Is there any practical way to get rid of this? It makes easier to ruin
a program by accident...
What a damned extension heh?
thanks
Diego Martins