Commit Graph

662 Commits

Author SHA1 Message Date
Victor Zverovich
8e6b2541a6 Apply coding conventions 2023-12-30 16:07:35 -08:00
Victor Zverovich
3a2c50d4ac Cleanup test 2023-12-19 15:28:10 -08:00
Victor Zverovich
18c43a214c Cleanup test 2023-12-19 13:46:48 -08:00
Vladislav Shchapov
6b07fff0d9
Make hex float test more stable on different libc (#3762)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2023-12-19 11:03:06 -08:00
Victor Zverovich
afa85e46c3 Apply clang-format 2023-12-17 07:32:22 -08:00
js324
6025bd7c37
Add localized formatting to non-decimal presentation types of ints (#3750) 2023-12-15 07:51:25 -08:00
Kefu Chai
274ba2645b
allow format_as() to format reference (#3739)
before this change, format_as() is unable to format a type which
has `auto format_as() -> const another_type&`, and `another_type`
is formattable. because `format_as_result` maps the result type
as it is, and the compiler refuses to compile
`static_cast<T*>(nullptr)`, where T is a reference type. but
it would be handy if we could use `format_as()` to format types
which, for instance, owns / inherit from a formattable type, and
delegate the formatter to these variables instead without creating
a copy of them.

in this change:

* instruct `format_as_result` to map the
  result type to the decayed type, so that `type` can be the decayed
  type of result type, and this also enables `type` to be formattable,
  as long as the decayed type is formattable.
* corresponding test is added to format-test.cc

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2023-12-10 08:49:53 -08:00
js324
573d74395b
error on bool arg w/ char pres_type (#3734) 2023-12-05 13:45:10 -08:00
Victor Zverovich
c4283ec471 Fix a libc++ warning and move the test to the right place 2023-11-25 08:20:53 -08:00
Victor Zverovich
c13753a70c Fix handling of invalid Unicode in precision 2023-11-18 08:36:11 -10:00
Victor Zverovich
649fe0fc8b Fix handling of null strings with the s specifier 2023-11-15 17:03:01 -10:00
June Liu
2ac6c5ca8b
Fix error C2668 on Windows with option /std:c++latest (#3680)
* Namespace-qualify to avoid ambiguity with std::format_to for format-test.cc

When build fmt with MSVC under option /std:c++latest, it failed due to `error 2668: 'std::format_to': ambiguous call to overloaded function`, so add namespace to qualify the call to format_to to avoid this issue.
2023-10-16 09:54:02 -07:00
Victor Zverovich
0e01e46c11 Implement nested formatter 2023-09-18 14:21:21 -07:00
Vladislav Shchapov
016b1faede
Fix symbol leak (#3627)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2023-09-16 07:26:36 -07:00
Victor Zverovich
d4987546a4 Add an experimental nested formatter 2023-09-10 11:56:55 -07:00
Vladislav Shchapov
e150ea0cc2 to_string supports types with format_as
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2023-08-13 08:39:52 -07:00
Victor Zverovich
d424862319 Fix fixed precision handling during rounding in long double 2023-08-07 13:56:53 -07:00
Victor Zverovich
e475859042 Fix overspecified tests 2023-07-20 14:09:22 -07:00
Victor Zverovich
388bc296b7 Fix fixed formatting of small long doubles 2023-07-20 12:06:05 -07:00
Victor Zverovich
9bea6ec04a Don't use deprecated checked_array_iterator 2023-07-20 07:12:06 -07:00
Victor Zverovich
661b23edeb Call parse on empty specs at compile time 2023-07-15 22:20:29 -07:00
Victor Zverovich
9158bea1e1 Remove old grisu tests 2023-06-18 18:15:09 +03:00
timsong-cpp
08ef0d0842
fix formatter<char*> (#3432) 2023-05-20 06:32:21 -07:00
Victor Zverovich
616a493786 Revert Char* formatter removal 2023-05-17 06:11:11 -07:00
Victor Zverovich
aeedac5884 Remove unneeded specialization 2023-05-13 07:46:47 -07:00
Vladislav Shchapov
eaa6307691
Make hex float test more stable (#3434)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2023-05-13 06:34:33 -07:00
Victor Zverovich
ea49c91cd1 Cleanup argument construction 2023-05-11 18:43:39 -07:00
June Liu
33f7150778
Fix error C2668 on msvc (#3378) 2023-04-11 06:27:28 -07:00
Victor Zverovich
fce74caa15 Disable problematic implicit conversions 2023-04-09 09:08:46 -07:00
Victor Zverovich
02bf4d1c1c Disable to_string_view ADL 2023-04-09 08:49:05 -07:00
Vladislav Shchapov
97aedeab48
Workaround a double-double hexfloat format (#3366)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2023-04-01 07:19:23 -07:00
Victor Zverovich
41cfc739fe Generalize format_as 2023-03-26 07:37:51 -07:00
Victor Zverovich
6549ffde8e Improve format_as safety 2023-03-19 12:09:54 -07:00
Victor Zverovich
98699719f8 Make # handling consistent with std::format 2023-02-26 10:15:16 -08:00
Shawn Zhong
87c066a35b
Implement println (#3267) 2023-01-24 12:30:00 -08:00
Victor Zverovich
09ed1ddb9c Cleanup tests 2023-01-02 09:58:12 -08:00
Victor Zverovich
a05ba44df8 Simplify format string parsing 2022-12-30 11:23:42 -08:00
Victor Zverovich
ffb9b1d13c Improve handling of signed types 2022-12-30 10:31:39 -08:00
Victor Zverovich
32190859ec Fix handling of char 2022-12-30 09:11:42 -08:00
Victor Zverovich
dfb857ebef Refactor format spec parsing 2022-12-25 07:25:32 -08:00
Victor Zverovich
407e7b7b6d basic_format_specs -> format_specs 2022-12-24 14:34:50 -08:00
Victor Zverovich
934c8e5f76 Refactor precision parsing 2022-12-24 13:29:23 -08:00
Victor Zverovich
9660e5b956 Remove redundant tests 2022-12-24 07:28:13 -08:00
Shawn Zhong
a585571e90 Ignore 0 character with align 2022-12-23 19:36:05 -08:00
Victor Zverovich
1dadeb8a33 Refactor width parsing 2022-12-23 18:29:59 -08:00
Vladislav Shchapov
e004f1d699 Fix for issue #3241
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-12-23 12:26:20 -08:00
Victor Zverovich
bde1a6070d Simplify fill and alignment parsing 2022-12-23 10:52:56 -08:00
Victor Zverovich
b90895412f Fix formatting of named arguments with locale 2022-12-15 09:59:40 -08:00
Victor Zverovich
3999fd193a Workaround an ADL issue 2022-12-11 09:32:17 -08:00
Radek Brich
62ceb181b1 fix #3105 - Compile-time error when mixing named argument with automatic indexing 2022-12-04 08:13:26 -08:00