[#TrySub]
= TrySub
:mrdocs:

Subtract j from i in place, only if it does not underflow&period;

== Synopsis

Declared in `&lt;util&sol;overflow&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    std::unsigned&lowbar;integral T,
    std::unsigned&lowbar;integral U&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
bool
TrySub(
    T& i,
    U const j) noexcept;
----

== Return Value

true if `i &gt;&equals; j` and the subtraction was applied, false if it was left unchanged&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *i*
| The minuend, updated to `i &hyphen; j` when the subtraction succeeds&period;
| *j*
| The amount to subtract&period;
|===


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