News for hackers. Stuff that matters.
Re:The Year of C++ Successor Languages by anonymoushn on Monday January 02, 2023 @08:40AM (#34217698)
> There is no cost to exceptions that are not thrown.

This is not true for a variety of reasons, but the main ones are maybe missed optimizations and otherwise-unnecessary spills of objects into memory so that their destructors may be called.

> Also in C++ you have operators that are integrated in the type system and are resolved at compile-time to know whether an given expression can throw an exception or not.

Maybe if you only have a single TU or LTO? In general any function from another TU can throw an exception so you don't have this.

Re:The Year of C++ Successor Languages by mgaunard on Monday January 02, 2023 @05:15PM (#34224443)
> This is not true for a variety of reasons, but the main ones are maybe missed optimizations and otherwise-unnecessary spills of objects into memory so that their destructors may be called.

The missed optimization opportunity you describe only affects the Windows ABI, designed in 1989.

> Maybe if you only have a single TU or LTO?

Whether a function can throw or not is part of its signature.