Customization point for handling domain constraint violations.
<mp-units/framework/customization_points.h>template<typename Rep>
struct constraint_violation_handler;
The library calls constraint_violation_handler<Rep>::on_violation(msg) when a domain constraint is violated (e.g., out-of-bounds value, non-negativity).
No default implementation is provided. When no specialization exists for a given Rep, the library uses MP_UNITS_EXPECTS directly (which may compile to nothing in release builds). Specializing this trait opts the type into guaranteed enforcement.
| Name | Description |
|---|---|
| Rep | the representation type |