Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How can you catch allocation failure from ::new? Is it possible without exceptions (which have some other problems in kernel space)?


One can use ::new(std::nothrow), which selects the non-throwing allocation function. Returns nullptr on failure.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: