Re: is auto_ptr part of STL?

Tech-Archive recommends: Fix windows errors by optimizing your registry



[I can see that server censored my answer, so I repost it
again.]



ultranet wrote:
Also, please vote for I)-thru-IV) at:

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-676075a748e9

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


.



Relevant Pages

  • Re: is auto_ptr part of STL?
    ... from non-compliance until VC .NET). ... nowadays almost nobody cares about VC6 anymore. ... rare situation when you write special handling for `operator ...
    (microsoft.public.vc.language)
  • Re: is auto_ptr part of STL?
    ... from non-compliance until VC .NET). ... nowadays almost nobody cares about VC6 anymore. ... rare situation when you write special handling for `operator ...
    (microsoft.public.vc.language)