Re: is auto_ptr part of STL?
- From: "Alex Blekhman" <tkfx.N05P4M@xxxxxxxxx>
- Date: Thu, 1 Jun 2006 17:04:04 +0300
[I can see that server censored my answer, so I repost it
again.]
ultranet wrote:
http://msdn.microsoft.com/newsgroups/default.aspx?pg=2&p=1&tid=efddffe4-851f-4c80-9d77-7d64d809f9da&dg=microsoft.public.vc.language&cat=&lang=&cr=&sloc=en-us&mid=34273d38-9736-4312-aba5-676075a748e9Also, please vote for I)-thru-IV) at:
Folks, please vote on I), II), III), or IV) at the above
link.
I'm now at III (use try-catch, and ignore possible issues
from non-compliance until VC .NET). But i'm seriously
thinking about IV (use VC-version-specific project-local
macros to ensure compliance on a project-by-project
basis). Wouldn't IV) be the best way to handle out of
memory errors?
Look, nowadays almost nobody cares about VC6 anymore. Having
that said, even less people care about esoteric throw
specifications of abandoned pre-standard compiler. It's very
rare situation when you write special handling for `operator
new' failure. Most of the time you just let the exception to
propagate up the stack. If `operator new' fails, then it's
a sign that you're already severely messed up. Caring about
possible memory leaks is of least concern in this situation.
I suggest you to read these articles to clarify yourself
what you really want from `operator new' and how to handle
what it can provide.
"To New, Perchance To Throw[1], Part 1"
http://www.gotw.ca/publications/mill15.htm
"To New, Perchance To Throw, Part 2"
http://www.gotw.ca/publications/mill16.htm
HTH
Alex
.
- Prev by Date: Re: static instance of a class optimized out of existence...
- Next by Date: Re: can't specialize a template
- Previous by thread: Re: is auto_ptr part of STL?
- Next by thread: Re: is auto_ptr part of STL?
- Index(es):
Relevant Pages
|