forked from mpusz/mp-units
libfmt updated to 6.2.0
This commit is contained in:
@@ -46,7 +46,7 @@ class UnitsConan(ConanFile):
|
|||||||
exports_sources = ["docs/*", "src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"]
|
exports_sources = ["docs/*", "src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"]
|
||||||
settings = "os", "compiler", "build_type", "arch"
|
settings = "os", "compiler", "build_type", "arch"
|
||||||
requires = (
|
requires = (
|
||||||
"fmt/6.1.0"
|
"fmt/6.2.0"
|
||||||
)
|
)
|
||||||
# scm = {
|
# scm = {
|
||||||
# "type": "git",
|
# "type": "git",
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
- Output streams formatting support added
|
- Output streams formatting support added
|
||||||
- Linear algebra from `std::experimental::math` support added
|
- Linear algebra from `std::experimental::math` support added
|
||||||
- Named SI units and their dimensions added (thanks [@rbrugo](https://github.com/rbrugo)
|
- 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
|
Many thanks to GitHub users [@oschonrock](https://github.com/oschonrock) and
|
||||||
|
@@ -77,9 +77,9 @@ namespace units {
|
|||||||
template <typename CharT>
|
template <typename CharT>
|
||||||
struct global_format_specs
|
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;
|
fmt::align_t align = fmt::align_t::none;
|
||||||
int width = 0;
|
int width = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Holds specs about the representation (%[specs]Q)
|
// Holds specs about the representation (%[specs]Q)
|
||||||
@@ -314,9 +314,9 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void on_error(const char* msg) { throw fmt::format_error(msg); }
|
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_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_width(int width) { f.global_specs.width = width; } // global
|
||||||
constexpr void on_plus() { f.rep_specs.sign = fmt::sign::plus; } // rep
|
constexpr void on_plus() { f.rep_specs.sign = fmt::sign::plus; } // rep
|
||||||
constexpr void on_minus() { f.rep_specs.sign = fmt::sign::minus; } // rep
|
constexpr void on_minus() { f.rep_specs.sign = fmt::sign::minus; } // rep
|
||||||
constexpr void on_space() { f.rep_specs.sign = fmt::sign::space; } // rep
|
constexpr void on_space() { f.rep_specs.sign = fmt::sign::space; } // rep
|
||||||
@@ -427,8 +427,8 @@ public:
|
|||||||
fmt::basic_memory_buffer<CharT> global_format_buffer;
|
fmt::basic_memory_buffer<CharT> global_format_buffer;
|
||||||
auto to_gfb = std::back_inserter(global_format_buffer);
|
auto to_gfb = std::back_inserter(global_format_buffer);
|
||||||
format_to(to_gfb, "{{:");
|
format_to(to_gfb, "{{:");
|
||||||
if (auto fill = global_specs.fill; fill != '\0') {
|
if (global_specs.fill.size() != 1 || global_specs.fill[0] != ' ') {
|
||||||
format_to(to_gfb, "{}", fill);
|
format_to(to_gfb, "{}", global_specs.fill.data());
|
||||||
}
|
}
|
||||||
if (auto align = global_specs.align; align != fmt::align_t::none) {
|
if (auto align = global_specs.align; align != fmt::align_t::none) {
|
||||||
switch (align) {
|
switch (align) {
|
||||||
|
Reference in New Issue
Block a user