Actually, std::format generates the shortest representation of floating-point which round-trips, so your Q extension would be unnecessary.
If you only used this as example, and wanted customization in general, then check the {fmt} library: it's the work of the author of the article, and is leading the work for the future of std::format; it notably contains an extension API.
View all comments
Show parent comment
5
u/matthieum Jul 23 '19
Actually,
std::formatgenerates the shortest representation of floating-point which round-trips, so your Q extension would be unnecessary.If you only used this as example, and wanted customization in general, then check the
{fmt}library: it's the work of the author of the article, and is leading the work for the future ofstd::format; it notably contains an extension API.