[#mp_units-utility-operator_eq-0e] = xref:mp_units.adoc[mp_units]::xref:mp_units/utility.adoc[utility]::operator== :relfileprefix: ../../ :mrdocs: Checks whether a `safe_int` equals a floating‐point value. == Synopsis Declared in `<mp‐units/utility/safe_int.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename U> requires treat_as_floating_point<U> [[nodiscard]] constexpr bool operator==( xref:mp_units/utility/safe_int-07.adoc[safe_int] lhs, U rhs); ---- [NOTE] ==== This function is a https://en.cppreference.com/w/cpp/language/friend[hidden friend] of xref:mp_units/utility/safe_int-07.adoc[safe_int], declared only inside that class: it can be found only through argument-dependent lookup. ==== == Return Value `true` if the wrapped value equals `rhs` [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Template Parameters [cols="1,4"] |=== | Name| Description | *U* | a floating‐point‐like type (`treat_as_floating_point<U>` is `true`) |=== == Parameters [cols="1,4"] |=== | Name| Description | *lhs* | the `safe_int` operand | *rhs* | the floating‐point value to compare against |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#