Commit Graph

5769 Commits

Author SHA1 Message Date
Victor Zverovich
eab2ea9fc2 Replace an assert with an exception 2021-12-26 07:05:45 -08:00
Victor Zverovich
21ed92a6e9 Update changelog 2021-12-24 07:25:23 -08:00
Vladislav Shchapov
04111dd1e4
Fix issue #2670 (#2671) 2021-12-23 12:38:48 -08:00
Alexey Ochapov
817788fbf0
remove incorrect C++20 check from test/CMakeLists.txt (#2663)
It disables entire branch of tests declaration unconditionally because CXX_STANDARD
is not defined there. But even we use CMAKE_CXX_STANDARD here, these tests should
not be disabled with standard >= C++20.
2021-12-23 12:32:03 -08:00
Victor Zverovich
4511030af2 Minor code style tweaks for consistency 2021-12-23 11:55:58 -08:00
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
Victor Zverovich
784e2a7b42 Fix an overflow when formatting very large durations 2021-12-23 10:34:32 -08:00
Stefan Weil
fc2a376d8e Remove two expressions which had no effect (reported by LGTM)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-12-22 16:29:16 -08:00
Alexey Ochapov
c5aafd8f90 expose headers as SYSTEM depending on special configuration option 2021-12-19 08:29:51 -08:00
Victor Zverovich
eaddd1e3cd Fix handling of byte 2021-12-19 06:46:24 -08:00
Victor Zverovich
2d44577586 Try fixing byte regression 2021-12-18 08:51:21 -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
Victor Zverovich
659de779e6 Fix a UB in parse_format_specs when begin is null 2021-12-17 16:51:24 -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
Alexey Ochapov
ef72b471fc
enable named arguments check in compile-time checks (#2649)
works only if all named arguments are UDL-based
2021-12-17 15:53:05 -08:00
Alexey Ochapov
82246b8766
fix throw with exceptions disabled (#2647) 2021-12-17 13:44:36 -08:00
Victor Zverovich
35f60377aa
Update ChangeLog.rst 2021-12-17 06:49:29 -08:00
Marek Kurdej
3a951a66cb
Avoid qualifying by inline namespace. Fixes #2642. (#2643) 2021-12-10 08:28:25 -08:00
Marek Kurdej
e0136fc8bd
Qualify calls to make_wformat_args. Fixes #2639. (#2641) 2021-12-10 06:36:42 -08:00
Victor Zverovich
ac1b5f3da5 Refactor problematic trailing returns in arg_mapper 2021-12-09 18:08:30 -08:00
Victor Zverovich
fd62fba985 Don't convert scoped enums to integers 2021-12-09 12:09:33 -08:00
Victor Zverovich
c652f8243a Make header guard consistent with header name 2021-12-09 10:49:47 -08:00
Victor Zverovich
a9c7b9b8f7 Clarify that _format is deprecated 2021-12-09 10:34:27 -08:00
Victor Zverovich
e4f0564aa6 Disable is_streamable for string[_view] 2021-12-09 10:02:18 -08:00
Victor Zverovich
91533d3c33 Minor tweaks to chrono subsecond formatting 2021-12-09 06:55:31 -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
Vladislav Shchapov
9d5b9defde
Enable tzset only on Windows desktop app (#2633) 2021-12-07 15:22:36 -08:00
Victor Zverovich
215f21a038 Detect overflow on large precision 2021-12-05 07:26:58 -08:00
Vladislav Shchapov
c240d98ffd
Optimize tm formatting (Non C-locales and %Z) (#2617)
* Move fmt::detail::formatbuf to format.h

* Replace std::basic_ostringstream to std::basic_ostream with custom formatbuf

* Use tm.tm_zone
2021-12-04 11:02:31 -08:00
Andrew Corrigan
6ab73113fc
Mark grow as FMT_CONSTEXPR20 (#2630)
resolves https://github.com/fmtlib/fmt/issues/2627
2021-12-03 07:13:30 -08:00
Victor Zverovich
713c7c7c62 Cleanup os.cc 2021-12-01 06:47:41 -08:00
Acretock
9b1807a8a2
fix int -> uint warning (#2611)
* fix int -> uint warning

* change unsigned int to mode_t

* undef + warn uint -> ushort loss presision

* fix mode_t

* mode_t in detail

Co-authored-by: Acretock <George.Goncharov@finch-xr.com>
2021-12-01 06:40:17 -08:00
Lounarok
ec3b097cb9
[doc] FMT_STRING supports C++14 and no-op in C++11 (#2620)
* FMT_STRING supports C++14 and no-op in C++11

* Move requirement to the end. Modify description.
2021-11-28 07:02:15 -08:00
Victor Zverovich
c472a27818 Fix handling of very large precision in fixed format 2021-11-27 08:23:05 -08:00
Alex Guteniev
201971e293
Make MSVC use [[nodiscard]] (#2615)
* Make MSVC use [[nodiscard]]
* Uniformly detect attributes for __cplusplus and _MSVC_LANG
2021-11-26 07:32:50 -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
Vladislav Shchapov
be3a3a5aed Use predefined formats for C-locale 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
Eric Curtin
19cac63fe4 Broken link in README.rst
Added src directory to link
2021-11-19 09:24:38 -08:00
Victor Zverovich
43419a4ada Workaround a bug in gcc 2021-11-19 07:32:42 -08:00
Vladislav Shchapov
c089f7d497 Simplify std::tm formatter 2021-11-14 07:16:22 -08:00
Vladislav Shchapov
aa5517f6b9 Reuse tm_writer in chrono_formatter 2021-11-14 07:16:22 -08:00
Vladislav Shchapov
50140be7ae Reuse tm_writer in weekday formatter 2021-11-14 07:16:22 -08:00