On 26/10/2026 15:03, Stefan Ram wrote:
According to reports in the World-Wide Web,
C++26 failed its DIS ballot. Maybe related
to contracts.
If you find more details, it would be nice to hear them.
I personally am disappointed in the way C++ contracts will work. It
appears to be too much an all-or-nothing approach for policies, often
puts the checks in the wrong place, and does not allow compilers to
assume that contracts are followed in order to optimise code.
To me, it seems obvious that it is up to the caller code to make sure
the preconditions are fulfilled - checking must therefore be on the
caller side, not the callee side. If the precondition fails, the bug is
in the caller code. In the implementation of the function, the compiler should be able to assume the precondition is true for optimisation
purposes. Similarly, any checking of postconditions should be on the
callee side, while the caller can assume the conditions hold.
You might want to have extra doubled-up checks at some points, such as
major API boundaries or when dealing with code that is not well tested
or fully trusted.
--- PyGate Linux v1.5.19
* Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)