mp_units::utility::parse_dynamic_spec

Parses a spec value that may be a literal integer or a {}-style dynamic argument reference.

Synopsis

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

template<
    std::forward_iterator It,
    typename Char = std::iter_value_t<It>>
[[nodiscard]]
constexpr
It
parse_dynamic_spec(
    It begin,
    It end,
    int& value,
    fmt_arg_ref<Char>& ref,
    std::basic_format_parse_context<Char>& ctx);

Return Value

an iterator past the parsed spec value, or begin when neither form is present

NOTE

The return value should not be discarded.

Parameters

NameDescription
beginthe beginning of the range to parse; must be non-empty
endthe end of the range to parse
valueupdated with the parsed value when it is a literal integer
refupdated with the referenced argument when the value is {}-style dynamic
ctxthe format parse context, used to validate a dynamic argument reference