Victor Zverovich
f0095ccd34
Add support for ranges of types without formatters to join ( #2262 )
2021-05-05 07:43:46 -07:00
Victor Zverovich
4f0eadfce4
Exclude fallback from is_formattable
2021-05-05 06:29:51 -07:00
Victor Zverovich
400b953fbb
Use [] instead of {} in ranges for consistency with Python format
2021-05-04 21:04:21 -07:00
Victor Zverovich
38bcc04a11
Drop range limit and cleanup tests
2021-05-04 20:53:56 -07:00
Victor Zverovich
9155e2de4c
Cleanup tests
2021-05-01 17:11:45 -07:00
Victor Zverovich
c9c0e5077d
Cleanup tests
2021-04-30 06:42:38 -07:00
Victor Zverovich
ccf4ccde23
Cleanup tests and format string compilation
2021-04-29 19:50:04 -07:00
Victor Zverovich
e96a92f869
Cleanup tests and format string compilation
2021-04-29 16:21:08 -07:00
Daniela Engert
342973b349
Make wchar_t overloads usable in module
...
Bring ''detail::find()' into scope.
2021-04-28 09:37:57 -07:00
Victor Zverovich
355be4b13f
Make FMT_COMPILE fallback on runtime without if constexpr ( #2261 )
2021-04-28 09:11:47 -07:00
Владислав Щапов
0cd0fb9184
C++17: std::char_traits<>::{compare,length} is constexpr - v2
2021-04-28 07:05:32 -07:00
Daniela Engert
d1a6e5603f
Keep defaulted destructors inline
...
applies to exception classes in case of msvc only
2021-04-28 06:17:26 -07:00
Victor Zverovich
84a36b99bf
Move data to functions
2021-04-27 17:21:32 -07:00
Victor Zverovich
ab7c33ede0
Suppress checked iterator warnings
2021-04-27 13:54:39 -07:00
Alexey Ochapov
77258f6069
fix FMT_CONSTEXPR_CHAR_TRAITS check for MSVC
2021-04-26 16:35:32 -07:00
Alexey Ochapov
f085c3d7a0
use proper check for non-type template parameters
2021-04-26 16:35:32 -07:00
Victor Zverovich
69bdc20a3c
Workaround missing std::system on iOS, take 2
2021-04-26 06:21:44 -07:00
Alexey Ochapov
1678ed6235
simplify field::format() and spec_field::format(), fix typo
2021-04-25 07:53:49 -07:00
Alexey Ochapov
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
Alexey Ochapov
ce6e7d8620
use fixed_string to create named arg class with static name for _a literal
2021-04-25 07:53:49 -07:00
Alexey Ochapov
fc56af14c2
move fixed_string from compile.h to format.h
2021-04-25 07:53:49 -07:00
Victor Zverovich
8f9ddf452d
Remove deprecated posix.h
2021-04-24 07:03:11 -07:00
Daniela Engert
d3c523e0d2
Export printf-related contexts from printf.h
2021-04-24 06:39:57 -07:00
Daniela Engert
2c25df089f
Export replacement type_traits, too
2021-04-24 06:39:57 -07:00
Victor Zverovich
553022dc56
Don't use std::system on iOS ( #2248 )
2021-04-24 06:17:05 -07:00
Victor Zverovich
8a040d187a
Cleanup core-test
2021-04-23 20:07:48 -07:00
Victor Zverovich
064cac2bf9
Bump version
2021-04-23 16:05:03 -07:00
Victor Zverovich
5b2c740ad8
Remove deprecated APIs
2021-04-23 15:27:25 -07:00
Victor Zverovich
b9ab5c8836
Remove printf.h dependency on ostream.h
2021-04-23 10:42:57 -07:00
Victor Zverovich
c47f211296
Simplify data handling
2021-04-23 06:52:10 -07:00
Victor Zverovich
54d3b1710e
Move more data out of basic_data
2021-04-23 06:45:23 -07:00
Vladislav Shchapov
128f007b25
C++17: std::char_traits<>::{compare,length} is constexpr. ( #2246 )
2021-04-23 06:11:34 -07:00
Victor Zverovich
841aad95b4
Move data out of basic_data
2021-04-22 15:29:42 -07:00
Alexey Ochapov
1d4199f46b
fix udl_compiled_string with non-byte chars (e.g. wchar) ( #2242 )
2021-04-19 08:29:35 -07:00
yumeyao
c5d4fcb119
Appending a space to guarantee non-empty strftime() result. ( #2244 )
2021-04-18 19:13:51 -07:00
Victor Zverovich
6271406233
Fix a warning ( #2233 )
2021-04-16 15:58:17 -07:00
denchat
52bd62c72f
Create separate dllexport marking points for clang and msvc. ( #2229 )
...
* add FMT_INSTANTIATION_DEF_API for msvc
This should fix https://github.com/fmtlib/fmt/issues/2228
To fix difference dllexport requirements
msvc: dllexport at template instantiation definition in format.cc
clang: dllexport at template instantiation declaration (extern template) in format.h
2021-04-16 12:34:18 -07:00
Daniela Engert
f4bbc54cc4
Tag official API for module export ( #2235 )
...
* functions
* classes
* UDLs
* other declarations
Export everything in namespace 'fmt' from core.h and format.h
2021-04-16 11:04:55 -07:00
Daniela Engert
d8910af80d
Use qualified name lookup rather than ADL. ( #2239 )
...
Name lookup within exported templates cannot find non-exported entities by ADL when instantiation takes place outside the module.
2021-04-16 09:38:25 -07:00
crbrz
9260114162
Ranges wide strings support ( #2236 )
...
* Ranges copy wchar_t
* arg_join formatter not working for wide strings
* Added ranges wide string tests
Co-authored-by: Cristi <cristi@emailaddressmanager.com>
2021-04-16 06:25:35 -07:00
denchat
42eccac454
Fix clang warning about ignoring __declspec(dllexport) on basic_data<void> template instantitation definition ( #2220 )
2021-04-12 09:31:44 -07:00
Victor Zverovich
99c2f7a349
Allow including fmt/core.h in the header-only mode
2021-04-10 07:44:36 -07:00
Elliot
78776ee4e2
Fix a conditional expression is constant warning #2210 ( #2211 )
2021-04-07 10:42:11 -07:00
jstaahl
266107f57c
constexpr uint128_wrapper ( #2215 )
...
* constexpr uint128_wrapper
* change FMT_CONSTEXPR to constexpr
* clang format
Co-authored-by: Jake Staahl <jstaahl@snapchat.com>
2021-04-06 22:07:01 -07:00
Alexey Ochapov
2e0d64cf2f
specify size for prefixes
static data
2021-04-06 17:07:14 -07:00
Victor Zverovich
95da484727
Fix a link
2021-04-03 09:14:52 -07:00
Victor Zverovich
06b3a1000c
Add support for time points with arbitrary durations ( #2208 )
2021-04-02 11:17:14 -07:00
Victor Zverovich
dac42f52b2
Inline fallback is_constant_evaluated
2021-04-01 10:42:09 -07:00
Victor Zverovich
7c43f8b896
Don't use strlen at compile time ( #2205 )
2021-04-01 10:04:21 -07:00
Jason Cobb
c62e4c30f4
Make buffer_appender default-constructible when back_insert_iterator is
2021-04-01 09:52:44 -07:00
Victor Zverovich
15c10b0c66
Add speech synthesis support
2021-04-01 09:19:36 -07:00
Billy Donahue
308510eb4f
"Use" fwrite
result (workaround for warn_unused_result
)
...
Fixes #2185
2021-03-31 08:31:35 -07:00
Victor Zverovich
b49af043d7
Remove noexcept from file's move assignment
2021-03-30 09:51:25 -07:00
vtta
14848875bf
Fix: fmt::ostream cannot be moved while holding buffered data #2197 ( #2198 )
...
* Add a test case: move ostream while holding data
* Fix moving ostream while holding data
Co-authored-by: Junliang HU <jlhu@cse.cuhk.edu.hk>
2021-03-30 08:43:26 -07:00
Victor Zverovich
b966afcc7a
Remove formattable
2021-03-28 14:21:12 -07:00
Victor Zverovich
ec5315a987
Use strlen when possible in fallback basic_string_view
2021-03-28 08:01:55 -07:00
Victor Zverovich
4f8778bab9
Inline basic_format_args's ctor
2021-03-28 07:32:17 -07:00
Yaser Afshar
e2d87548f8
user-defined constructor
...
user-defined constructor added to prevent Intel compilers
warnings. According to the standard, objects need to have a
user-defined constructor if instances are delcared const.
2021-03-28 06:56:14 -07:00
Yaser Afshar
f7151d384b
Extra flag to prevent Intel compiler with Clang front-end warning of 'unknown attribute no_sanitize'
2021-03-28 06:56:14 -07:00
Victor Zverovich
0fb8ef8f79
Inline trivial argument handling functions
2021-03-27 19:05:39 -07:00
Victor Zverovich
1b23e25f95
Simplify formattability check
2021-03-27 18:57:18 -07:00
Victor Zverovich
35c71ff536
Only use -Og with optimizations disabled
2021-03-27 11:35:01 -07:00
Victor Zverovich
243d8bebd1
Enable minimal optimizations in debug mode
2021-03-27 08:40:07 -07:00
Chris White
9b34681d97
Work around xl compiler bug when nvcc preprocesses this file ( #2190 )
2021-03-27 06:05:49 -07:00
Victor Zverovich
9cb347b4b2
Simplify argument formatters
2021-03-21 09:31:46 -07:00
Ryan Sherlock
0f85a4683a
add default cases ( #2186 )
...
Adding default case for switch statements where the compilation
flag -Wswitch-default is present on the command line when spdlog
is included in external projects.
Signed-off-by: Ryan Sherlock <ryan.m.sherlock@gmail.com>
2021-03-19 16:56:52 -07:00
Victor Zverovich
417e1cee9e
Stop using deprecated UDL templates
2021-03-19 08:34:55 -07:00
Victor Zverovich
f7e900e12e
Simplify UDL definitions
2021-03-19 08:10:58 -07:00
Victor Zverovich
d9661c8f3b
Mark grouping as deprecated
2021-03-19 07:54:57 -07:00
Victor Zverovich
14a2a64df4
Fix handling of formattable types with to_string_view ( #2181 )
2021-03-19 06:43:38 -07:00
Victor Zverovich
6ae402fd0b
Fix handling of types with to_string_view and formatter specialization ( #2180 )
2021-03-18 11:25:43 -07:00
Victor Zverovich
1147782c79
Fix an ambiguous call to check caused by ADL ( #2184 )
2021-03-17 20:59:36 -07:00
VZ
2f3f3862fa
Fix harmless MSVS warning about using undefined _MANAGED symbol ( #2183 )
...
Since the changes of 1305cbeb
(Fix MSVC2019 error C2049 when compiling
with /clr (#1897 ), 2020-09-23), compiling fmt with MSVS 2019 resulted in
fmt\include\fmt\core.h(180,32): warning C4668: '_MANAGED' is not defined
as a preprocessor macro, replacing with '0' for '#if/#elif'.
when the (disabled by default) warning C4668 was enabled.
Fix this simply by checking if _MANAGED is defined before testing it.
2021-03-17 11:21:50 -07:00
Brainy0207
d0bded5988
Fix MSVC /clr builds ( #2179 )
2021-03-15 08:17:28 -07:00
Victor Zverovich
8308f52c2a
Fix dynamic_format_arg_store::push_back comment
2021-03-15 07:10:28 -07:00
Victor Zverovich
5a1127b726
Don't wrap named arg in cref and clarify docs
2021-03-14 09:08:08 -07:00
moiwi
b8ff3c1820
optimize append ( #2164 )
2021-03-13 07:21:23 -08:00
Alexey Ochapov
c8d8b88223
fix GCC 7,8,9 warning about unused but set parameter ( #2177 )
2021-03-13 06:36:53 -08:00
Victor Zverovich
bac14ef985
Simplify integer spec checking
2021-03-12 15:02:01 -08:00
Victor Zverovich
8f9db3fcb8
Make ubsan happy on empty format specs ( #2175 )
2021-03-12 09:13:47 -08:00
Victor Zverovich
af567538a0
Bitpack integral prefixes
2021-03-11 21:22:33 -08:00
Victor Zverovich
cdf877d4b1
Workaround missed optimization opportunity
2021-03-11 16:44:59 -08:00
Victor Zverovich
eef4ba9c02
Optimize integer formatting without padding
2021-03-11 15:47:58 -08:00
Victor Zverovich
a1ea8a82c3
Unbloat my heart
2021-03-11 08:27:53 -08:00
Victor Zverovich
a457e16360
Simplify integer formatter
2021-03-11 08:14:03 -08:00
Victor Zverovich
05bc87a66f
Optimize padding
2021-03-10 17:59:36 -08:00
Victor Zverovich
605b603735
Optimize count_digits for powers of 2
2021-03-10 14:48:07 -08:00
Victor Zverovich
85ba271639
Implement 128-bit count_digits in terms of count_digits_fallback
2021-03-10 12:57:46 -08:00
Victor Zverovich
d9835737f0
spec -> specs
2021-03-10 12:51:03 -08:00
Victor Zverovich
60f5d24411
Simplify arg_formatter
2021-03-10 09:35:48 -08:00
Victor Zverovich
30e1302e73
Simplify on_format_specs
2021-03-10 08:46:16 -08:00
Victor Zverovich
87c5cd46ac
Optimize parsing of argument ids
2021-03-10 07:04:04 -08:00
Alexey Ochapov
6a9016ea60
fix formatted_size
with "compiled format" as argument ( #2161 )
2021-03-07 06:44:36 -08:00
Victor Zverovich
6e1fc01752
Move detail::truncating_iterator to fmt/compile.h
2021-03-06 08:35:36 -08:00
Jason Cobb
e718ec3e93
Make truncating_iterator an output_iterator ( #2158 )
2021-03-04 15:53:08 -08:00
John Steele Scott
772aeca338
Don't include <cassert>. ( #2148 ) ( #2152 )
...
* Don't include <cassert>. (#2148 )
This commit replaces use of the assert() macro in format-inl.h with
FMT_ASSERT(). This allows us to drop the cassert include.
* FMT_GCC_VERSION is not defined when we include test-assert.h, use __GCC__ instead.
* Don't explicitly suppress GCC's -Wterminate in tests' FMT_ASSERT.
Throwing from a separate function is enough to silence the warning, no need to
explicitly suppress it.
* Remove messages from assertions added in 2f699d2.
* Correct formatting around throw_assertion_failure().
2021-03-04 07:28:04 -08:00
Alexey Ochapov
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
Alexey Ochapov
d8b9254301
use simplified void_t
for all compilers other than gcc 4.x ( #2160 )
2021-03-02 14:42:27 -08:00
Victor Zverovich
835b910e7d
Add an is_formattable trait
2021-02-28 15:25:33 -08:00
Victor Zverovich
578874033a
Revert "Optimize handling of integer constants" ( #2147 )
...
This reverts commit 2797588be1
.
2021-02-25 05:58:58 -08:00