93 Commits

Author SHA1 Message Date
4a149f513f Test non-SSO constexpr string formatting 2025-06-20 07:10:12 -07:00
730fd4d9a7 Remove redundant tests 2025-06-08 08:46:22 -07:00
5860688d7e Enable constexpr support for fmt::format (fmtlib#3403) (#4456) 2025-06-07 07:16:49 -07:00
d42a068dbd Apply coding conventions 2025-02-05 11:06:45 -08:00
f2cec917da Move is_compiled_string to public API (#4342) 2025-02-04 16:20:27 -08:00
898d438571 Fix formatting into std::ostreambuf_iterator using a compiled format (#4312)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2025-01-18 07:16:06 -08:00
168df9a064 Implement fmt::format_to into std::vector<char> (#4211)
* Implement fmt::format_to into std::vector<char>

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

* Move get_container to the trait

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

---------

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2024-10-26 09:23:59 -07:00
2b6a786e35 Use standard context in print 2024-10-20 09:08:24 -07:00
565461a0d3 Update MSVC workaround in compile-test 2024-09-04 06:43:05 -07:00
c59ee969f3 Improve compile-time formatting (#4127) 2024-08-21 12:02:47 -07:00
5ee14d3508 Reintroduce constexpr fmt::formatted_size for C++20 (#4103)
* Reintroduce constexpr fmt::formatted_size for C++20

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

* Disable constexpr fmt::formatted_size on Visual Studio 2019

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

---------

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2024-08-03 07:13:32 -07:00
ba36a04811 Remove counting_iterator 2024-07-22 16:24:13 -07:00
f6b4a23b83 Unbloat chrono 2024-07-22 15:46:58 -07:00
d70729215f Fix constness 2024-01-14 06:44:38 -08:00
52174953bc Cleanup conseval detection 2024-01-12 05:59:22 -08:00
961df829b9 Fix buffer overflow if output iterator is std::back_insert_iterator and value is escaped (debug format)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2024-01-10 09:15:16 -08:00
e2ab9ab22b Add FMT_GLIBCXX_RELEASE 2024-01-02 16:15:23 -08:00
50565f9853 Move misplaced join overloads to fmt/ranges.h 2024-01-01 16:28:59 -08:00
923005bd4f Add stdlib version check for C++20 (#3754)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2023-12-17 08:33:17 -08:00
6c845f57e5 Fix formatted_size with FMT_COMPILE and format specs (#3588)
Addresses issue #3586
2023-08-15 06:45:48 -07:00
436c131d4c Optimize compiled format_to_n 2023-07-20 12:35:01 -07:00
858e528abd Use dragon in constexpr 2023-05-23 06:30:09 -07:00
33b4c33c5b Requires FMT_CONSTEXPR20 support
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-29 13:33:48 -07:00
fd93b633b8 Constexpr formatted_size (#3026)
* Constexpr formatted_size

* Add C++20 tests for gcc 9 and 10

* Adjust unit test to require __cpp_lib_bit_cast
2022-08-10 09:35:30 -07:00
831132293b Workaround for Microsoft Visual Studio 2022 Internal compiler error.
D:\a\fmt\fmt\test\compile-test.cc(362,3): fatal error C1001: Internal compiler error. [D:\a\fmt\build\test\compile-test.vcxproj]
(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\CxxFE\sl\p1\c\constexpr\constexpr.cpp', line 8635)

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-04 07:18:21 -07:00
115e00e0b9 Replace __cplusplus with FMT_CPLUSPLUS.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-04 07:18:21 -07:00
e927149f8e Cleanup macros 2022-05-29 17:23:02 -07:00
b02e5af52c fmt::join support FMT_COMPILE (#2720) 2022-01-14 09:58:49 -08:00
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
dcd282bb26 Namespace qualify calls to get 2021-10-09 07:15:14 -07:00
f28cf3302d adding a default format for std::chrono::time_point<std::chrono::syst… (#2345) 2021-06-11 10:52:39 -07:00
9976869549 fix custom types formatting at compile-time, add test 2021-06-01 11:16:05 -07:00
ee52a6dc40 add fmt::print() overload to support compiled format (#2304) 2021-05-25 14:54:56 -07:00
9155e2de4c Cleanup tests 2021-05-01 17:11:45 -07:00
ccf4ccde23 Cleanup tests and format string compilation 2021-04-29 19:50:04 -07:00
e96a92f869 Cleanup tests and format string compilation 2021-04-29 16:21:08 -07:00
53ca0cbe75 gtest: move GTest/GMock files to separate directory, update GTest/GMock usages
* all GTest/GMock files moved to `test/gtest` directory
* `CMakeLists.txt` created in `test/gtest` from `CMakeLists.txt` in `test`
* GTest/GMock target in CMake renamed to `gtest` (was `gmock`)
* CMake `gtest` target updated to export includes as "gtest/gtest.h" or "gmock/gmock.h" only
* includes in tests updated: "gtest.h" -> "gtest/gtest.h", "gmock.h" -> "gmock/gmock.h"
* removed duplications of `target_include_directories` for GTest/GMock directories (CMake manages them)
2021-04-29 07:11:49 -07:00
355be4b13f Make FMT_COMPILE fallback on runtime without if constexpr (#2261) 2021-04-28 09:11:47 -07:00
ca821982ee use named arg with static name in compile-time API
to get arg index by name at compile-time
2021-04-25 07:53:49 -07:00
1d4199f46b fix udl_compiled_string with non-byte chars (e.g. wchar) (#2242) 2021-04-19 08:29:35 -07:00
b441532396 CI linux: add clang++-11 C++20 (with LLVM libc++) build
* find-package-test fixed by passing CXX_FLAGS, i.e. -stdlib=libc++
 * std::array usage in compile-test.cc replaced with plain array, because
   <array> header was not included
2021-04-10 07:20:05 -07:00
14a2a64df4 Fix handling of formattable types with to_string_view (#2181) 2021-03-19 06:43:38 -07:00
f9e0e90441 Apply clang-format 2021-03-10 12:08:02 -08:00
6a9016ea60 fix formatted_size with "compiled format" as argument (#2161) 2021-03-07 06:44:36 -08:00
6e1fc01752 Move detail::truncating_iterator to fmt/compile.h 2021-03-06 08:35:36 -08:00
684b5b0e40 Fix fallback to runtime API from compile-time API (#2143)
* fix fallback to the runtime API, add FMT_ENABLE_FALLBACK_TO_RUNTIME_API define, add test

* remove `FMT_ENABLE_FALLBACK_TO_RUNTIME_API`

* pass format string to format_to() inside format_to_n() in compile-time API

instead of compiling it inside format_to_n(), to eliminate code duplication
2021-03-04 07:20:57 -08:00
29cc8282b1 update chrono duration formatter (constness), use it in compile-test for specs checks 2021-02-20 11:50:12 -08:00
499047e132 fix incorrect indexing mode for named args, update tests 2021-02-20 11:50:12 -08:00
78c67157c1 prepare tests, fix incorrect handling of named args with simple {} replacement fields 2021-02-20 11:50:12 -08:00
95e1aa2dc5 add support for manual indexing and named fields, add tests 2021-02-20 11:50:12 -08:00