[#mp_units-check_non_negative]
= xref:mp_units.adoc[mp&lowbar;units]::check&lowbar;non&lowbar;negative
:relfileprefix: ../
:mrdocs:

Policy that checks the value is ≥ 0 and reports violations&period;

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;overflow&lowbar;policies&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct check&lowbar;non&lowbar;negative;
----

== Description

Intended for quantities that are inherently non&hyphen;negative (e&period;g&period;, _length_, _mass_, _duration_)&period; Automatically applied to `natural&lowbar;point&lowbar;origin&lt;QS&gt;` when `QS` is tagged `non&lowbar;negative` in the ISQ&period;

If the quantity&apos;s representation type has a `constraint&lowbar;violation&lowbar;handler` specialization, the handler&apos;s `on&lowbar;violation()` is called on negative values (providing guaranteed enforcement regardless of build mode)&period; Otherwise, falls back to `MP&lowbar;UNITS&lowbar;EXPECTS`, which may be disabled in release builds&period;

== Member Functions

[cols=1]
|===
| Name
| xref:mp_units/check_non_negative/operator_call.adoc[`operator()`] 
|===

== Data Members

[cols=1]
|===
| Name
| xref:mp_units/check_non_negative/min.adoc[`min`] 
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
