mirror of
https://github.com/fmtlib/fmt.git
synced 2026-05-04 19:44:09 +02:00
Get rid of bit fields
This commit is contained in:
+9
-9
@@ -516,19 +516,19 @@ template <size_t N> constexpr auto parse_test_specs(const char (&s)[N]) {
|
||||
}
|
||||
|
||||
TEST(base_test, constexpr_parse_format_specs) {
|
||||
static_assert(parse_test_specs("<").align == fmt::align::left, "");
|
||||
static_assert(parse_test_specs("*^").fill.get<char>() == '*', "");
|
||||
static_assert(parse_test_specs("+").sign == fmt::sign::plus, "");
|
||||
static_assert(parse_test_specs("-").sign == fmt::sign::none, "");
|
||||
static_assert(parse_test_specs(" ").sign == fmt::sign::space, "");
|
||||
static_assert(parse_test_specs("#").alt, "");
|
||||
static_assert(parse_test_specs("0").align == fmt::align::numeric, "");
|
||||
static_assert(parse_test_specs("L").localized, "");
|
||||
static_assert(parse_test_specs("<").align() == fmt::align::left, "");
|
||||
static_assert(parse_test_specs("*^").fill_unit<char>() == '*', "");
|
||||
static_assert(parse_test_specs("+").sign() == fmt::sign::plus, "");
|
||||
static_assert(parse_test_specs("-").sign() == fmt::sign::none, "");
|
||||
static_assert(parse_test_specs(" ").sign() == fmt::sign::space, "");
|
||||
static_assert(parse_test_specs("#").alt(), "");
|
||||
static_assert(parse_test_specs("0").align() == fmt::align::numeric, "");
|
||||
static_assert(parse_test_specs("L").localized(), "");
|
||||
static_assert(parse_test_specs("42").width == 42, "");
|
||||
static_assert(parse_test_specs("{42}").width_ref.index == 42, "");
|
||||
static_assert(parse_test_specs(".42").precision == 42, "");
|
||||
static_assert(parse_test_specs(".{42}").precision_ref.index == 42, "");
|
||||
static_assert(parse_test_specs("f").type == fmt::presentation_type::fixed,
|
||||
static_assert(parse_test_specs("f").type() == fmt::presentation_type::fixed,
|
||||
"");
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -368,7 +368,7 @@ const char* parse_scan_specs(const char* begin, const char* end,
|
||||
switch (to_ascii(*begin)) {
|
||||
// TODO: parse more scan format specifiers
|
||||
case 'x':
|
||||
specs.type = presentation_type::hex;
|
||||
specs.set_type(presentation_type::hex);
|
||||
++begin;
|
||||
break;
|
||||
case '}':
|
||||
@@ -437,7 +437,7 @@ auto read_hex(scan_iterator it, T& value) -> scan_iterator {
|
||||
template <typename T, FMT_ENABLE_IF(std::is_unsigned<T>::value)>
|
||||
auto read(scan_iterator it, T& value, const format_specs& specs)
|
||||
-> scan_iterator {
|
||||
if (specs.type == presentation_type::hex) return read_hex(it, value);
|
||||
if (specs.type() == presentation_type::hex) return read_hex(it, value);
|
||||
return read(it, value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user