Open IndianBoy42 opened 1 week ago
Yes, this function is missing (PRs are welcome).
write vs. write_...: I understand what you mean but each function has different optional parameters. I am not a big fan of unclear overload resolutions. Maybe as additional function.
Maybe we can have an additional function that just forwards to format_to(writer, "{}", value)
as a more generic convenience method and then have write_*
as more configurable (and maybe slightly more optimized) methods for specific values.
I will have to look into how the formatting machinery actually works but I can try and get a PR in next weekend
The API of write_float
API should be similar to std::to_chars.
The generic template<T> write(T)
could dispatch to write_int/char/str/float
depending on T. Using format_to
cannot (easily) work since this would be a circular dependency.
I would think anything formattable by
format/format_to
should also be able to be directly formatted and written to aemio::writer
. Also would it be better/possible to just have an overloadedwriter::write
method instead ofwrite_char,write_str,write_int,...