c++ - Why should I check the return value of operator NEW? -
meyers in book "50 ways improve..."
second edition writes must check return type of new, know if operator new
can't allocate memory throws exception
, newer libraries don't need check return value of new, right? in advance
in general, think you're correct: modern libraries throw exceptions this. if you're distributing source, compilers still return null rather throwing exception. in situations, can useful, depends whether you're going there debug , how critical stability of program is.
also, else pointed out such obscure problem nowadays burden on person using ancient compiler.
Comments
Post a Comment