MCPcopy Create free account
hub / github.com/fmtlib/fmt / handle_dynamic_spec

Method handle_dynamic_spec

include/fmt/format.h:3736–3747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3734
3735template <typename Context>
3736FMT_CONSTEXPR void handle_dynamic_spec(
3737 arg_id_kind kind, int& value,
3738 const arg_ref<typename Context::char_type>& ref, Context& ctx) {
3739 if (kind == arg_id_kind::none) return;
3740 auto arg =
3741 kind == arg_id_kind::index ? ctx.arg(ref.index) : ctx.arg(ref.name);
3742 if (!arg) report_error("argument not found");
3743 ullong result = arg.visit(dynamic_spec_getter());
3744 if (result > to_unsigned(max_value<int>()))
3745 report_error("width/precision is out of range");
3746 value = static_cast<int>(result);
3747}
3748
3749#if FMT_USE_NONTYPE_TEMPLATE_ARGS
3750template <typename T, typename Char, size_t N,

Callers

nothing calls this directly

Calls 5

report_errorFunction · 0.85
dynamic_spec_getterClass · 0.85
to_unsignedFunction · 0.85
argMethod · 0.45
visitMethod · 0.45

Tested by

no test coverage detected