Re:Investigating the Performance Overhead of C++ Exceptions
by gpderetta on Wednesday February 12, 2020 @05:01AM
(#22307505)
C++ had runtime checked exceptions, which aside for the except/noexcept case, were pretty useless (and never implemented by MSVC).
I'm a huge fan of checked exception, given a type system powerful enough to parametrize over them (C++ should be more than capable), so I'm looking forward to the development. Stroustrup is not a fan though and he might kill the effort.
Re:Investigating the Performance Overhead of C++ Exceptions
by pjmlp on Wednesday February 12, 2020 @10:02AM
(#22309300)
I imagine that if value type exceptions get added, they will be exposed in the type system just like noexcept is.
Re:Investigating the Performance Overhead of C++ Exceptions
by gpderetta on Wednesday February 12, 2020 @11:53AM
(#22310405)
oh, yes. As far as I can tell, these static exceptions are basically syntactic sugar over an either<T, Except> return type, possibly with a custom ABI that stores the discriminant implicitly in a flag register (so on the call side you do not even need to load the discriminant and compare it and instead directly do a JMPcc ).
However value type exceptions might re-introduce it, just in a different form, with luck on C++23.