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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -