libfmt updated to 6.2.0

This commit is contained in:
Mateusz Pusz
2020-05-05 22:44:42 +02:00
parent ffd3af42d2
commit 4607e69e24
3 changed files with 9 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ class UnitsConan(ConanFile):
exports_sources = ["docs/*", "src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"]
settings = "os", "compiler", "build_type", "arch"
requires = (
"fmt/6.1.0"
"fmt/6.2.0"
)
# scm = {
# "type": "git",

View File

@@ -20,6 +20,7 @@
- Output streams formatting support added
- Linear algebra from `std::experimental::math` support added
- Named SI units and their dimensions added (thanks [@rbrugo](https://github.com/rbrugo)
- libfmt updated to 6.2.0
- ...
Many thanks to GitHub users [@oschonrock](https://github.com/oschonrock) and

View File

@@ -77,7 +77,7 @@ namespace units {
template <typename CharT>
struct global_format_specs
{
CharT fill = '\0';
fmt::internal::fill_t<CharT> fill = fmt::internal::fill_t<CharT>::make();
fmt::align_t align = fmt::align_t::none;
int width = 0;
};
@@ -314,7 +314,7 @@ private:
}
void on_error(const char* msg) { throw fmt::format_error(msg); }
constexpr void on_fill(CharT fill) { f.global_specs.fill = fill; } // global
constexpr void on_fill(basic_string_view<CharT> fill) { f.global_specs.fill = fill; } // global
constexpr void on_align(align_t align) { f.global_specs.align = align; } // global
constexpr void on_width(int width) { f.global_specs.width = width; } // global
constexpr void on_plus() { f.rep_specs.sign = fmt::sign::plus; } // rep
@@ -427,8 +427,8 @@ public:
fmt::basic_memory_buffer<CharT> global_format_buffer;
auto to_gfb = std::back_inserter(global_format_buffer);
format_to(to_gfb, "{{:");
if (auto fill = global_specs.fill; fill != '\0') {
format_to(to_gfb, "{}", fill);
if (global_specs.fill.size() != 1 || global_specs.fill[0] != ' ') {
format_to(to_gfb, "{}", global_specs.fill.data());
}
if (auto align = global_specs.align; align != fmt::align_t::none) {
switch (align) {