[#mp_units-utility-at_most_one_of]
= xref:mp_units.adoc[mp&lowbar;units]::xref:mp_units/utility.adoc[utility]::at&lowbar;most&lowbar;one&lowbar;of
:relfileprefix: ../../
:mrdocs:

Finds the single modifier from `modifiers` present in &lsqb;begin, end)&period;&rsqb;

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;utility&sol;format&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::forward&lowbar;iterator It&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
It
at&lowbar;most&lowbar;one&lowbar;of(
    It begin,
    It end,
    std::string&lowbar;view modifiers);
----

== Description

Throws when more than one is used, which is how a `format&hyphen;spec` states that a group of modifier letters is mutually exclusive&period;

== Return Value

the position of the single modifier present, or `end` when there is none

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

[cols="1,4"]
|===
| Name| Description
| *begin*
| the beginning of the range to search
| *end*
| the end of the range to search
| *modifiers*
| the set of mutually exclusive modifier characters to look for
|===


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