Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on I disagree with Linus Torvalds about C++ (2009). Parent comment
2) allocation can fail but you do not care to handle it. Your application will abort on an exception which is the best scenario.
3) allocation can fail and you want to handle it non locally (for example in a constructor). Exceptions work well in this scenario.
4) allocation can fail and you want to handle it locally: new(nothrow) is your friend. Remember to check for '!= nullptr'.
2) allocation can fail but you do not care to handle it. Your application will abort on an exception which is the best scenario.
3) allocation can fail and you want to handle it non locally (for example in a constructor). Exceptions work well in this scenario.
4) allocation can fail and you want to handle it locally: new(nothrow) is your friend. Remember to check for '!= nullptr'.