Viatorus / emio

A safe and fast high-level and low-level character input/output library for bare-metal and RTOS based embedded systems with a very small binary footprint.
https://viatorus.github.io/emio/
MIT License
132 stars 4 forks source link

Support dynamic fill, width and precision #9

Closed Viatorus closed 1 year ago

Viatorus commented 1 year ago

fmt does this through extra replacement fields inside the format syntax:

fmt::format("{:<{}}", "left aligned", 30);
// Result: "left aligned                  "

fmt does not support fill (because of performance). For the same reason + code bloat I suggest not using the format syntax for this but make it somehow possible to pass this directly to the formatter as extra option.

E.g. (never tested, just a 5 minute brainstorming idea):

emio::format("{:<}", emio::dyn{"left aligned", .width = 30});
// Result: "left aligned                  "