Rewrote format_impl.h functions to work with both decimal and binary

This commit is contained in:
2022-02-15 09:37:02 +01:00
parent c3eb1e2909
commit fa0fef37db
5 changed files with 60 additions and 137 deletions

View File

@@ -5,7 +5,7 @@
using namespace const_fmt;
int main() {
constexpr auto s = "This is an integer: {:08}, and this is a float: {:09.4}"_const_fmt(12345, -86.2);
constexpr auto s = "This is an integer: {:08b}, and this is a float: {:09.4b}"_const_fmt(125u, -86.2);
// Convert s (with a type of 'std::array<char, N>') into something
// writable to std::cout