News for hackers. Stuff that matters.
Re:I disagree with Linus Torvalds about C++ (2009) by gpderetta on Monday December 24, 2018 @09:08AM (#18752187)
There are 4 options: 1) allocation can't fail for whatever reason. So new won't ever throw.

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'.

Re:I disagree with Linus Torvalds about C++ (2009) by amelius on Monday December 24, 2018 @09:35AM (#18752289)
Exceptions require special stack-unwinding logic, which may not be adequate for a kernel (?)
Re:I disagree with Linus Torvalds about C++ (2009) by gpderetta on Monday December 24, 2018 @09:42AM (#18752313)
Sure (although there is work ongoing to fix that), but that's only relevant for point 3 and in that case 4 is an option.