Commit Graph

1549 Commits

Author SHA1 Message Date
lucpelletier
7812813a32
Don't explicitly delete copy ctor of dynamic_format_arg_store (#2664)
* Don't explicitly delete copy ctor of dynamic_format_arg_store

Explicitly deleting the copy ctor causes the move constructor to not be
implicitly generated. This behaviour is different than what was in
v8.0.1 and causes code that relied on the move ctor of
dynamic_format_arg_store to break.

* Add test for dynamic_format_arg_store's move ctor

* include <memory>, don't use make_unique
2021-12-23 11:34:16 -08:00
Victor Zverovich
664cd6067d Remove std-format-test 2021-12-23 10:58:02 -08:00
Alexey Ochapov
e46392ea2c deprecate _format UDL in code using FMT_DEPRECATED 2021-12-18 08:33:20 -08:00
Victor Zverovich
c882790a2e Add a set formatter 2021-12-18 07:35:40 -08:00
Victor Zverovich
121002d700 Add a map formatter 2021-12-18 07:12:53 -08:00
Victor Zverovich
be51ee1ceb Disable broken copy ctor of dynamic_format_arg_store 2021-12-17 17:18:18 -08:00
Alexey Ochapov
51b14b6c0c remove commented out lines 2021-12-17 16:05:56 -08:00
Alexey Ochapov
223a0fa55d move gtest-specific check into gtest/CMakeLists.txt 2021-12-17 16:05:56 -08:00
Victor Zverovich
fd62fba985 Don't convert scoped enums to integers 2021-12-09 12:09:33 -08:00
Victor Zverovich
e4f0564aa6 Disable is_streamable for string[_view] 2021-12-09 10:02:18 -08:00
matrackif
0bbc9708f9
Implement c++20 std::chrono::duration subsecond formatting (#2623)
* Add support for subsecond printing for std::chrono::duration according to the c++20 standard

* Remove assert test that overflows intmax_t

* * Hopefully fix int64_t to int32_t conversion errors.
* Allow proper Duration::rep type to propagate via template argument deduction

* * Hopefully fix int64_t to int32_t conversion errors.
* Allow proper Duration::rep type to propagate via template argument deduction

* Fix sign conversion (-Wsign-conversion) warning treated as error in num_digits()

* Format chrono.h with clang-format

* Remove extra forward slash in doxygen style comment

Co-authored-by: Victor Zverovich <victor.zverovich@gmail.com>

* Apply all suggestions from GitHub, except for replacing the utility subsecond_helper class with a function

* * Move logic of handling subseconds from utility class to function with name write_fractional_seconds()
* Revert write(Rep value, int width) function to previous state

* Fix -Wshadow warning

* Remove unsued get_subseconds() function, its logic has been moved to write_fractional_seconds()

* Change comment from lowercase int to uppercase Int

* Simplify test check

* Integrate suggested changes

* Remove static from detail functions, they are no longer member functions of a class and static is unnecessary.
* Change comment from "amount" to "number"

Co-authored-by: Victor Zverovich <victor.zverovich@gmail.com>
2021-12-09 06:45:13 -08:00
Victor Zverovich
215f21a038 Detect overflow on large precision 2021-12-05 07:26:58 -08:00
Victor Zverovich
c472a27818 Fix handling of very large precision in fixed format 2021-11-27 08:23:05 -08:00
Florin Iucha
acad8cfab1 Reformat all source code; no functional changes
Before adding the format checker, the mainline should be clean, to
avoid false failures.
2021-11-25 09:15:25 -08:00
Florin Iucha
491ba2dda5 Annotate fmt::format and fmt::formatted_size as [[nodiscard]]
This prevents accidentally writing fmt::format when fmt::print was
intended. Other than running tests, there's not a good use case for
discarding the formatted output.
2021-11-25 07:30:30 -08:00
Vladislav Shchapov
5abe9e8266 Add platform-specific 'z' formatter 2021-11-25 06:52:39 -08:00
Alex Guteniev
a3ab36c803
Formatting of function pointers, member function pointers, member object pointers... (#2610) 2021-11-23 12:55:22 -08:00
Victor Zverovich
5380ff4d88 Detect types convertible to unformattable pointers 2021-11-13 08:26:27 -08:00
lukester1975
12b1d8b14a
Fix precision 0 with std::chrono::duration and added additional tests. (#2588) 2021-11-06 08:57:22 -07:00
Victor Zverovich
028f227752 Handle implicit conversions in write 2021-10-31 08:58:54 -07:00
Victor Zverovich
5b0aa638cf Minor grammar fix 2021-10-30 09:14:13 -07:00
Vladislav Shchapov
1031eedf27
Replacing strftime with std::time_put (#2550)
* Fix unicode test

* Add xchar support to chrono formatter

* Replace strftime with std::time_put

* Add std::locale support to std::tm formatter

* Use predefined names and formats for C-locale

* Performance improvement

* Make locale-independent and C locale formats consistent among platforms
2021-10-30 08:25:45 -07:00
Vladislav Shchapov
90034e4c4b
Add FMT_ASSERT and validation of values of struct tm members (#2564)
Switch internal year calculations to long long
2021-10-27 13:29:07 -07:00
Daniela Engert
df40e94673
Upgrade module-test to msvc 16.11.5 and 17.0-pre5 (#2558) 2021-10-24 08:12:39 -07:00
Victor Zverovich
1266c2b600 Fix handling of exotic character types 2021-10-17 09:07:48 -07:00
Vladislav Shchapov
aeb54b0dd9 Fix bug on '%Y' and '%C' formats with negative years
Requested changes
2021-10-16 15:03:57 -07:00
Vladislav Shchapov
f88c020fc0 Generalization of strftime/wcsftime function calls in tests 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
2754546080 Fix errors in ISO week-base-year formatter 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
218cecb6d1 Fix error in test 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
5dc3dd3d4a New tests 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
4707373d33 Fix year formatter 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
79c00ad8f2 Improve ISO week-base-year formatter 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
cde44ddb72 Improve year formatter 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
b04601b918 Switch from std::strftime/std::wcsftime to internal implementation for locale independent formats 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
d3d30a46f0 New tests 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
509eac9575 Workarounds for implementation-defined std::strftime behavior 2021-10-16 15:03:57 -07:00
Vladislav Shchapov
85b38190d1 New tests for all C++11 std::strftime format specifiers 2021-10-16 15:03:57 -07:00
Barry Revzin
7aca36bca4
Extending fmt::join to support C++20-only ranges. (#2549) 2021-10-16 10:02:03 -07:00
Josh Essman
f56756986b fix: check to make sure both 'if constexpr' and return type deduction are available
fix: remaining ifdefs
2021-10-14 10:44:24 -07:00
Victor Zverovich
dcd282bb26 Namespace qualify calls to get 2021-10-09 07:15:14 -07:00
Victor Zverovich
e1bd6cc913 Refactor FP formatting 2021-09-26 10:25:46 -07:00
Victor Zverovich
ff7e73af66 Always run grisu_gen_digits before fallback_format 2021-09-26 07:54:25 -07:00
Victor Zverovich
2976e31ac9 Refactor format_float 2021-09-25 11:20:56 -07:00
Alexey Ochapov
b4d9d82e1d
make FP formatting available to be used at compile-time (#2426)
* works only with FMT_HEADER_ONLY
* works only with float and double types (not long double)
2021-09-18 08:03:23 -07:00
Vladislav Shchapov
d9fd695ac7 Fix wchar_t tm formatting 2021-09-15 07:33:24 -07:00
Vladislav Shchapov
92614ecbf9 Optimize %T in tm formatting 2021-09-15 07:33:24 -07:00
Victor Zverovich
67cb2dad37 Optimize %F in tm formatting 2021-09-10 07:48:50 -07:00
Victor Zverovich
894faf3fed Refactor presentation types 2021-09-06 13:32:33 -07:00
Victor Zverovich
6b55c83252 is_const_formattable -> has_const_formatter 2021-09-05 08:35:08 -07:00
Victor Zverovich
2fe94ad7e3 Make specifiers support in tuple_join an opt-in 2021-09-05 07:34:06 -07:00