News for hackers. Stuff that matters.
Re:Investigating the Performance Overhead of C++ Exceptions by ncmncm on Wednesday February 12, 2020 @06:10AM (#22307844)
Some abstractions have no overhead under any circumstances, others have no runtime cost if not used. It is not inconsistent to include the former, trivially.
Re:Investigating the Performance Overhead of C++ Exceptions by throwaway17_17 on Wednesday February 12, 2020 @10:35AM (#22309613)
But my point in making the distinction is that Stroustrup does not intend to say that 'zero-overhead' is equal to 'no runtime cost if not used'. Stroustrup favors the following:

'zero-overhead' for some feature is equal to 'no runtime overhead above what one would incur from coding the feature yourself.

That definition explicitly does not include the concept that 'zero-overhead' features carry no cost when not used. In fact, the entire point of Bjarne discussing what "zero-cost" means in his response to Sutter's exception proposal, is to state that for C++ (which originated the term) "zero-cost"/zero-overhead does not mean that language features do not incur cost by inclusion in the language, like with exceptions. There is a cost to code during runtime if one does not explicitly remove exceptions from the language at compile time. Stroustrup's point is that this built in runtime overhead from having an exception mechanism built into C++ does not violate the language's 'zero-cost' guarantee.

Re:Investigating the Performance Overhead of C++ Exceptions by voxic11 on Wednesday February 12, 2020 @11:41AM (#22310289)
He actually seems to use the term to refer to both concepts. Quoting him

"What you don’t use, you don’t pay for. And further: What you do use, you couldn’t hand code any better."