-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Rename `ExpectsAudit()` to `gsl_ExpectsAudit()` Reason: it's an extension and not a feature specified in the Core Guidelines. See #201. * Restructure contract configuration macros We now have the following independent groups: - contract checking control: - `gsl_CONFIG_CONTRACT_CHECKING_AUDIT` - `gsl_CONFIG_CONTRACT_CHECKING_ON` (default) - `gsl_CONFIG_CONTRACT_CHECKING_OFF` - contract checking control for individual contract types: - `gsl_CONFIG_CONTRACT_CHECKING_EXPECTS_OFF` - `gsl_CONFIG_CONTRACT_CHECKING_ENSURES_OFF` - contract violation control: - `gsl_CONFIG_CONTRACT_VIOLATION_THROWS` - `gsl_CONFIG_CONTRACT_VIOLATION_TERMINATES` (default) - `gsl_CONFIG_CONTRACT_VIOLATION_CALLS_HANDLER` - how unenforced contracts are handled: - `gsl_CONFIG_UNENFORCED_CONTRACTS_ASSUME` - `gsl_CONFIG_UNENFORCED_CONTRACTS_ELIDE` (default) * `gsl_noexcept` no longer depends on contract violation settings Having the definition of `gsl_noexcept` vary depending on a configuration macro can lead to type and ABI incompatibilities because `noexcept` is part of the type system since C++17. Following the Lakos rule, functions with a narrow contract should not be marked `noexcept`, not even conditionally. (cf. https://quuxplusone.github.io/blog/2018/04/25/the-lakos-rule/) An exception is made for functions which only call move constructors or move assignment operators; these are made unconditionally `noexcept`. The reasoning is that a throwing move constructor would be unsound anyway.
- Loading branch information
Showing
5 changed files
with
176 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.