[#mp_units-constraint_violation_handler-0c] = xref:mp_units.adoc[mp_units]::constraint_violation_handler :relfileprefix: ../ :mrdocs: Customization point for handling domain constraint violations. == Synopsis Declared in `<mp‐units/framework/customization_points.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Rep> struct constraint_violation_handler; ---- == Description 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. == Template Parameters [cols="1,4"] |=== |Name|Description | *Rep* | the representation type |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#