[#mp_units-check_non_negative] = xref:mp_units.adoc[mp_units]::check_non_negative :relfileprefix: ../ :mrdocs: Policy that checks the value is ≥ 0 and reports violations. == Synopsis Declared in `<mp‐units/overflow_policies.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct check_non_negative; ---- == Description Intended for quantities that are inherently non‐negative (e.g., _length_, _mass_, _duration_). Automatically applied to `natural_point_origin<QS>` when `QS` is tagged `non_negative` in the ISQ. If the quantity's representation type has a `constraint_violation_handler` specialization, the handler's `on_violation()` is called on negative values (providing guaranteed enforcement regardless of build mode). Otherwise, falls back to `MP_UNITS_PRECONDITION`, which may be disabled in release builds. == Member Functions [cols="1,4"] |=== | Name| Description | xref:mp_units/check_non_negative/operator_call.adoc[`operator()`] | Checks that `v` is non‐negative and reports a violation otherwise. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:mp_units/check_non_negative/min.adoc[`min`] | Lower domain bound: zero in any unit. Consumed by quantity_point::min() and std::numeric_limits<quantity_point>::lowest(). The operator() uses V::zero() directly (no unit scaling needed); this member exists solely for the numeric_limits interface. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#