How do I pass the field width as an argument? All the examples that use a field width have it hardcoded in the string, e.g., format("{:<30}", "left aligned");
The width and precision fields allow an integer or arg_id to be specified:
http://fmtlib.net/latest/syntax.html#grammar-token-width
See:
https://github.com/fmtlib/fmt/issues/303#issuecomment-208329512
And applying to your example, @gnzlbg, what @mwinterb wrote, we get:
format("{:<{}}", "left aligned", 30);
Thanks you two!
Most helpful comment
The width and precision fields allow an integer or arg_id to be specified:
http://fmtlib.net/latest/syntax.html#grammar-token-width
See:
https://github.com/fmtlib/fmt/issues/303#issuecomment-208329512