Abstract
Assertions are Boolean expressions that are expected to be true at a given point in the code. The assert macro of <cassert> is defined similar to
#ifdef NDEBUG #define assert(_) #else #define assert(CONDITION) \ if (!(CONDITION)) { print_msg(__FILE__, __LINE__, ...); std::abort(); } #endif
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
A mixin is a class that provides some functionality to add to other classes (in this case, the capability of storing a pointer to a nested exception and some related functions). In C++, mixins are generally implemented through multiple inheritance.
- 2.
std::exp() only sets errno for implementations where math_errhandling defined in <cmath> contains MATH_ERRNO: see Chapter 1. This appears to be mostly the case though.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Peter Van Weert and Marc Gregoire
About this chapter
Cite this chapter
Van Weert, P., Gregoire, M. (2019). Diagnostics. In: C++17 Standard Library Quick Reference. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4923-9_8
Download citation
DOI: https://doi.org/10.1007/978-1-4842-4923-9_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-4922-2
Online ISBN: 978-1-4842-4923-9
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books