ACCU2019 - Programming with Contracts in C++20

ACCU2019 - Programming with Contracts in C++20

Design by Contract is a technique to clearly express which parts of a program has which responsibilities. In the case of bugs, contracts can mercilessly point a finger at the part that violated the contract.

Contracts are coming as a language feature in C++20. I will show how they can make your interfaces clearer with regards to use, but also point out pitfalls and oddities in how contracts are handled in C++.

Writing good contracts can be difficult. I intend to give you guidance in how to think when formulating contracts, and how to design your interfaces such that good contracts can be written, because contracts have effects on interface design.

Warning: Parts of the contents are personal opinion.

5d138ccf47c8d79aa8f0d29900f9e07b?s=128

Björn Fahller

April 12, 2019
Tweet