Re:Catching use-after-move C++ bugs with Clang's consumed an...
by bluGill on Wednesday July 10, 2019 @03:31PM
(#20405578)
Contracts come in several forms. Some are checked at compile time. Some are checked at run time. Some the check is too expensive to actually run but is left for documentation. Compilers are expected to have a switch to turn off run time checking for production (just like assert)
[ Parent
| on HN ]
Re:Catching use-after-move C++ bugs with Clang's consumed an...
by bigcheesegs on Wednesday July 10, 2019 @04:47PM
(#20406365)
Nothing in C++20 contracts requires any checking to be done at compile time. The only options currently required are runtime checking and no checking.
Re:Catching use-after-move C++ bugs with Clang's consumed an...
by bluGill on Thursday July 11, 2019 @09:07AM
(#20411181)
Contracts were designed so that they can be checked statically.
Pedantically you are correct: checking contracts is expected to be too expensive to actually do as part of a build. C++ expects that static analysis will check contracts as well (static analysis is might take 10 hours to check what compiles in 10 minutes)