mp_units::utility::at_most_one_of

Finds the single modifier from modifiers present in [begin, end).]

Synopsis

Declared in <mp-units/utility/format.h>

template<std::forward_iterator It>
[[nodiscard]]
constexpr
It
at_most_one_of(
    It begin,
    It end,
    std::string_view modifiers);

Description

Throws when more than one is used, which is how a format-spec states that a group of modifier letters is mutually exclusive.

Return Value

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

NOTE

The return value should not be discarded.

Parameters

NameDescription
beginthe beginning of the range to search
endthe end of the range to search
modifiersthe set of mutually exclusive modifier characters to look for