Commit Graph

689 Commits

Author SHA1 Message Date
Victor Zverovich
e9c1c415b8 Improve compile-time checks 2021-05-19 07:57:57 -07:00
Victor Zverovich
0dd91e20d5 Add wchar.h for wide char overloads 2021-05-17 21:59:10 -07:00
Victor Zverovich
d35f1ad5c1 Cleanup core 2021-05-16 10:02:33 -07:00
Alexey Ochapov
54f22a3eef add support for statically named arguments with FMT_STRING 2021-05-14 16:31:10 -07:00
Victor Zverovich
16f2ef91ab Replace fmt::system_error with std::system_error 2021-05-07 08:33:39 -07:00
Victor Zverovich
9c3af11a92 Cleanup tests 2021-05-05 18:31:41 -07:00
Victor Zverovich
f0095ccd34 Add support for ranges of types without formatters to join (#2262) 2021-05-05 07:43:46 -07:00
Victor Zverovich
9155e2de4c Cleanup tests 2021-05-01 17:11:45 -07:00
Victor Zverovich
38127d9ec0 Cleanup tests 2021-04-30 15:50:03 -07:00
Alexey Ochapov
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
Victor Zverovich
5b2c740ad8 Remove deprecated APIs 2021-04-23 15:27:25 -07:00
denchat
24c9751558
Try to suppress MVSC warn of narrowing (#2230) 2021-04-13 07:30:43 -07:00
Victor Zverovich
5a8bf1f6a3 Workaround hexfloat inconsistency on windows (#2205) 2021-04-07 11:20:08 -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
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
Victor Zverovich
7e72673d87 Improve width estimation (#2033) 2021-02-13 09:30:29 -08:00
Victor Zverovich
13b117b5bc Improve code point computation 2021-02-13 08:46:19 -08:00
Mike Crowe
e6ef927e6b
fmt::ptr: Support function pointers (#2131)
Passing a function pointer to fmt::ptr results in:

 In file included from /home/mac/git/fmt/test/gmock/gmock.h:238,
                  from /home/mac/git/fmt/test/format-test.cc:31:
 .../fmt/test/format-test.cc: In member function ‘virtual void FormatterTest_FormatPointer_Test::TestBody()’:
 .../fmt/test/format-test.cc:1486:56: error: no matching function for call to ‘ptr(void (&)(int, double, std::__cxx11::string))’
              format("{}", fmt::ptr(function_pointer_test)));

with GCC and Clang. Let's add an overload to support that usage.

Unfortunately, MSVC would
consider the overload to be ambiguous for unknown reasons:

 D:\a\fmt\fmt\test\format-test.cc(1485,1): error C2668: 'fmt::v7::ptr': ambiguous call to overloaded function [D:\a\fmt\build\test\format-test.vcxproj]
 D:\a\fmt\fmt\include\fmt/format.h(3742,60): message : could be 'const void *fmt::v7::ptr<void,int,double,std::string>(T (__cdecl *)(int,double,std::string))' [D:\a\fmt\build\test\format-test.vcxproj]
           with
           [
               T=void
           ]
 D:\a\fmt\fmt\include\fmt/format.h(3735,42): message : or       'const void *fmt::v7::ptr<void(int,double,std::string)>(T (__cdecl *))' [D:\a\fmt\build\test\format-test.vcxproj]
           with
           [
               T=void (int,double,std::string)
           ]
 D:\a\fmt\fmt\test\format-test.cc(1486,1): message : while trying to match the argument list '(overloaded-function)' [D:\a\fmt\build\test\format-test.vcxproj]

but luckily this means that the overload is unnecessary in that case
anyway, so we can just make it conditional.
2021-02-09 07:35:16 -08:00
Victor Zverovich
ce519e939b Fix exception propagation from iterators (#2097) 2021-01-23 17:27:24 -08:00
Ivan Polyakov
8bf28e6bb1
Add support for s format specifier to bool (#2094) (#2109) 2021-01-23 07:32:41 -08:00
Victor Zverovich
7fd535c6ae Cleanup 'L' handling 2021-01-18 07:57:38 -08:00
Victor Zverovich
e4f2cf455e Make 'L' a modifier 2021-01-17 09:28:46 -08:00
Victor Zverovich
532e846b86 Fix width computation in float formatter 2021-01-15 11:07:55 -08:00
Victor Zverovich
f8c2f8480a Fix handling of width when formatting int as char 2021-01-14 08:41:17 -08:00
Victor Zverovich
0fe0b15e71 Fix handling of # in width computation 2021-01-13 16:48:07 -08:00
Alexey Ochapov
d09b5c1453
Fix std::byte formatting with compile-time API (#2072)
* add test for byte formatting with `FMT_COMPILE`

* fix byte formatting with `FMT_COMPILE`, use `__cpp_lib_byte` macro

* use is not custom mapped type check

* workaround MSVC bug
2020-12-27 07:23:28 -08:00
Victor Zverovich
3551f5d118 Workaround a gcc 10 -Warray-bounds bug (#2065) 2020-12-19 09:34:43 -08:00
Victor Zverovich
33f9a6d360 Fix handling of enums in to_string (#2036) 2020-12-03 15:18:33 -08:00
Victor Zverovich
4a6eadbde0 Make std::byte formattabe (#1981) 2020-12-03 08:59:07 -08:00
Victor Zverovich
22a68d1613 Don't emit trailing zeros by default 2020-11-27 07:45:54 -08:00
Victor Zverovich
2c734c9bca Fix an overflow in format_to_n (#2029) 2020-11-18 06:50:43 -08:00
Victor Zverovich
bcc20b29df Implement compile-time checks by default 2020-11-15 17:24:36 -08:00
Walter Gray
befd7d4a2f
Always use FMT_STRING internally where possible [Issue #2002] (#2006)
Co-authored-by: Walter Gray <walter.gray@getcruise.com>
2020-11-15 05:19:06 -08:00
Victor Zverovich
f8640d4050 Add more standards 2020-11-14 12:02:46 -08:00
Victor Zverovich
f81c14aa1e Workaround an issue with mixing std versions in gcc (#2017) 2020-11-14 11:41:51 -08:00
Jonathan Gopel
1b8f499ee1
🔧 Silence useless cast warnings (#2008)
Problem:
- gcc-10 is generating the following warning at all standards:

    test/format-test.cc: In member function 'virtual void UtilTest_BitCast_Test::TestBody()':
    test/format-test.cc:108:42: error: useless cast to type 'uint64_t' {aka 'long long unsigned int'} [-Werror=useless-cast]
      108 |   s = fmt::detail::bit_cast<uint32_pair>(uint64_t(~0ull));
          |                                          ^~~~~~~~~~~~~~~
- gcc-8 is generating the following warning at all standards:
    test/format-test.cc: In member function 'virtual void UtilTest_BitCast_Test::TestBody()':
    test/format-test.cc:108:56: error: useless cast to type 'uint64_t' {aka 'long long unsigned int'} [-Werror=useless-cast]
       s = fmt::detail::bit_cast<uint32_pair>(uint64_t(~0ull));
                                                        ^
Solution:
- Cast 0 to a 64 unsigned bit int and then invert.

Co-authored-by: Jonathan Gopel <jgopel@quantlab.com>
2020-11-11 07:56:59 -08:00
Victor Zverovich
5bedcb665b Fix initialization of iterator_buffer (#1996) 2020-11-08 08:08:55 -08:00
Victor Zverovich
6b7bfed40c Fix fallback float formatter at assymetric bounds (#1976) 2020-11-03 19:19:10 -08:00
Jonathan Gopel
e904e891bd 🎨 🐛 Rename all shadowed types and variables 2020-11-03 07:30:27 -08:00
Vladislav Shchapov
97c8873214
Allocator::max_size support in basic_memory_buffer (#1960) 2020-10-29 06:17:00 -07:00
Victor Zverovich
86287b8d56 Optimize common case in parse_format_specs 2020-10-21 17:16:58 -07:00
Victor Zverovich
0ecb3d1829 Optimize alignment parsing 2020-10-21 12:45:11 -07:00
Victor Zverovich
e57ec7d563 Merge vformat_to overloads 2020-10-20 17:39:50 -07:00
Victor Zverovich
e3b4c22ec9 Simplify is_output_iterator 2020-10-20 14:09:57 -07:00
Victor Zverovich
20d4f2e836 Fix handling of weird character types when parsing sign (#1932) 2020-10-17 09:40:30 -07:00
Bart Siwek
271eff149f
Make classes derived from buffer<T> final to silence the virtual destructor warning. (#1937)
Co-authored-by: Bart Siwek <bsiwek@cisco.com>
2020-10-15 17:41:56 -07:00
Victor Zverovich
7eddbfed53 Cleanup exponent handling in write_float 2020-10-07 15:58:43 -07:00
Victor Zverovich
a18b3fbbdc Fix fixed precision handling when rounding (#1917) 2020-10-07 07:42:23 -07:00
Victor Zverovich
90ef46df0b Fix dragonbox integration 2020-09-28 18:10:46 -07:00
Victor Zverovich
51f2e2ca27 Move nan test to where it belongs 2020-09-27 12:50:18 -07:00
Victor Zverovich
68555fdbd2 Make format-test not depend on color.h 2020-09-27 09:17:57 -07:00
Victor Zverovich
a905d8f704 Merge grisu-test into format-test 2020-09-26 08:23:16 -07:00
Victor Zverovich
c156093ffd Fix carry in fallback_format 2020-09-25 10:12:44 -07:00
Victor Zverovich
2d4fde3a2e Don't emit trailing zero for consistency with std::format 2020-09-23 09:19:12 -07:00
Victor Zverovich
16410056bf Optimize copy_str for counting_iterator 2020-09-22 07:56:09 -07:00
Victor Zverovich
7e6827521a Remove trailing zeros when using fallback formatter (#1873) 2020-09-17 08:16:21 -07:00
Victor Zverovich
5b5a597198 Fix handling of wide alignment 2020-09-15 06:53:06 -07:00
Victor Zverovich
dce8e49b4f Handle float in fallback formatter 2020-09-13 09:28:40 -07:00
Victor Zverovich
9f312fe87e Implement fallback FP formatting with given precision (#1526) 2020-09-07 09:34:30 -07:00
Barry Revzin
6be6544668
Fixing buffer_appender's ++ slicing (#1822)
* Fixing buffer_appender's ++ slicing.

* This test requires C++14.

* Removing string_view dependency.

* Simplifying test case.

* Adding message to static_assert
2020-08-18 12:37:56 -07:00
medithe
f9f02df719
CMakeLists.txt: Clang-warnings: removed -Wno-sign-conversion (#1817)
* CMakeLists.txt: Clang-warnings: removed -Wno-sign-conversion

* test/ranges-test.cc: changed type of integer literals to unsigned

* test/format-test.cc: fixed implicit conversion changes signedness warning in clang

Co-authored-by: Martin Wührer <martin.wuehrer@artech.at>
2020-08-14 13:58:20 -07:00
Victor Zverovich
4fd95e4b4d Don't remove trailing zeros with # 2020-08-08 08:14:39 -07:00
Victor Zverovich
065889a593 Use correct capacity in iterator_buffer (#1807) 2020-08-08 07:01:21 -07:00
Barry Revzin
d0dd678693 Adding convenience append(range) 2020-08-08 06:33:46 -07:00
Victor Zverovich
21c8b5c142 Report error on missing named argument (#1796) 2020-07-30 07:16:15 -07:00
Victor Zverovich
a2c4fed981 Double buffering no more 2020-07-10 20:35:14 -07:00
Victor Zverovich
b998e0f30b Reduce symbol sizes and simplify iterator use 2020-07-09 08:51:43 -07:00
Victor Zverovich
56fed78149 FMT_NUMERIC_ALIGN -> FMT_DEPRECATED_NUMERIC_ALIGN 2020-07-03 08:53:01 -07:00
Victor Zverovich
56e63078ff Make the n specifier an opt-in 2020-07-03 08:02:48 -07:00
Victor Zverovich
98a7a8b405 Update changelog and disable internal 2020-06-26 19:07:33 -07:00
Victor Zverovich
2cac8a9d2e Reintroduce UDT support to fmt::to_string and test ADL 2020-06-21 09:21:07 -07:00
Victor Zverovich
397ad1bec3 Optimize common case 2020-06-15 18:30:31 -07:00
Victor Zverovich
50bad7d62d Optimize format string parsing 2020-06-06 10:15:19 -07:00
Victor Zverovich
f11e968708 Optimize format string parsing 2020-06-06 08:15:33 -07:00
Victor Zverovich
f095c67b6a Remove uses of buffer_range 2020-05-29 18:14:03 -07:00
Victor Zverovich
19c5b5d159 Simplify arg_formatter 2020-05-29 16:53:12 -07:00
Victor Zverovich
519571edec Simplify arg_formatter_base 2020-05-29 14:44:18 -07:00
Victor Zverovich
6d66de3805 Add c specifier support to integral types (#1652) 2020-05-17 08:44:59 -07:00
Victor Zverovich
8069265373 internal -> detail (#1538) 2020-05-10 07:34:30 -07:00
Victor Zverovich
7f723fbcb8 Consistently namespace qualify size_t 2020-05-07 15:59:46 -07:00
Victor Zverovich
c06851456d Purge basic_writer 2020-05-07 15:04:48 -07:00
Victor Zverovich
2f05054dd3 Purge basic_writer 2020-05-07 11:35:41 -07:00
Victor Zverovich
a71bc9c825 Use '0' fill with numeric align for consistency with std::format 2020-05-03 09:52:31 -07:00
Victor Zverovich
1e1ac6e964 Check dynamic width/precision id at compile time (#1614) 2020-04-25 08:36:24 -07:00
Victor Zverovich
e51c449fe6 Revert "Check dynamic widht/precision id at compile time (#1614)"
This reverts commit 7d748a6f82.
2020-04-25 07:43:56 -07:00
Victor Zverovich
7d748a6f82 Check dynamic widht/precision id at compile time (#1614) 2020-04-22 14:45:37 -07:00
Victor Zverovich
2b75bd7ce6 Get rid of do_check_format_string 2020-04-22 12:15:29 -07:00
Victor Zverovich
811b0f9054 Enable compile-time error tests 2020-04-22 11:00:20 -07:00
Victor Zverovich
5944fcad37 Remove remaining wchar_t instantiation 2020-04-19 16:48:15 -07:00
Victor Zverovich
8a4630686e Improve handling of named arguments 2020-04-14 11:56:55 -07:00
Victor Zverovich
e99809f29d Fix ostream support in sprintf (#1631) 2020-04-12 07:53:17 -07:00
Victor Zverovich
bbb6b357c7 Add floating-point L specifier (#1624) 2020-04-10 07:16:20 -07:00
Victor Zverovich
d1d653d895 Implement the L specifier 2020-04-02 06:58:38 -07:00
Victor Zverovich
80ce222ca6 Fix wide print overload (#1609) 2020-03-28 09:44:18 -07:00
Scott Ramsby
664dd88e31 Enable FMT_STRING() use with types other than string literals 2020-03-24 12:56:21 -07:00
Victor Zverovich
69779b4ed6 Fix handling of small precision in general format 2020-03-24 09:01:57 -07:00
Victor Zverovich
ff486a72a7 Allow leading zeros in precision (#1579) 2020-03-14 11:37:38 -07:00
Victor Zverovich
678341275b Deprecate fmt::char8_t 2020-03-14 10:32:34 -07:00
Victor Zverovich
153f753bde Deprecate undocumented _u suffix 2020-03-04 19:20:19 -08:00
Victor Zverovich
eafd079868 Improve width computation 2020-03-04 17:17:34 -08:00
Victor Zverovich
1e8493196e Make compile-time checks in format_to handle references 2020-03-01 07:57:34 -08:00
Victor Zverovich
09a13244c8 Disallow passing non-string-literals to FMT_STRING 2020-01-22 21:05:46 -08:00
Victor Zverovich
419db8baa1 Fix length computation of constexpr C strings 2020-01-22 18:25:07 -08:00
Victor Zverovich
b4218aa0f8 Test invalid fill 2020-01-19 16:52:36 -08:00
Victor Zverovich
e5f2f8ce7a Add variable-width fill support (#1109) 2020-01-19 14:49:51 -08:00
Victor Zverovich
9e3f3e8cff Fix handling of output iterators in format_to_n (#1506) 2020-01-05 09:59:01 -10:00
Daniela Engert
cb8e7caf7c Convert 'char8_t' character sequences to 'char' sequences
Otherwise, Google Test will insist on inserting 'char8_t' NTBS into 'char' streams, but basic_ostream<char>::operator<< overloads taking 'char8_t' arguments are defined as deleted by P1423.
Handling individual 'char8_t's is done inline.

This fixes the compilation errors seen in C++20 mode beginning with VS2019 Update 2.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2020-01-04 07:01:48 -10:00
Victor Zverovich
c85efef312 More showpoint fixes and tests (#1498) 2019-12-30 13:08:35 -10:00
Victor Zverovich
f219dcd59b Add fmt::bytes 2019-12-24 10:45:15 -08:00
Victor Zverovich
dea7fde8b7 Deprecate u8string_view 2019-12-24 09:44:57 -08:00
Victor Zverovich
e6b37b4aff Handle block boundaries in utf8_to_utf16 2019-12-21 16:33:34 -08:00
Victor Zverovich
74532c23a3 Make type a scoped enum 2019-12-21 12:22:17 -08:00
Victor Zverovich
1b1c70108a trailing_zeros -> showpoint 2019-12-18 12:12:09 -08:00
Victor Zverovich
1afe201ae8 Handle block boundaries in utf8_to_utf16 2019-12-18 10:35:51 -08:00
Victor Zverovich
35959a31d7 Move OS-specific APIs to a separate header 2019-12-15 11:46:45 -08:00
Victor Zverovich
ec2463c905 Implement utf8_to_utf16 using utf8_decode 2019-12-15 09:35:26 -08:00
Victor Zverovich
9e450911fa Give an error on precision overflow 2019-12-14 07:45:27 -08:00
Victor Zverovich
9f2e7edaeb Fix handling of types convertible to std::string_view 2019-12-09 13:25:08 -08:00
Florin Iucha
d3aa0c3a28 Clean-up sign-conversion warnings in test code 2019-12-08 16:07:43 -08:00
Victor Zverovich
31de9a1b80 Revert "Clean-up sign-conversion warnings in test code"
This reverts commit 227bfe62dd.
2019-12-08 15:47:24 -08:00
Florin Iucha
227bfe62dd Clean-up sign-conversion warnings in test code 2019-12-08 15:21:38 -08:00
Deniz Evrenci
1ab80aa92c Fix handling of types with custom formatters that are convertible to std::string_view 2019-12-06 11:40:21 -08:00
Victor Zverovich
8bbe76af3a Add a missing decimal point in exponent notation with trailing zeros 2019-12-02 11:36:33 -08:00
Victor Zverovich
b994a0ab13 Fix handling of missing fraction in snprintf_float 2019-11-29 06:17:29 -08:00
Victor Zverovich
d19ed6716d Fix hexfloat buffer reallocation 2019-11-25 15:54:04 -08:00
Victor Zverovich
28d7191c27 Don't print trailing zero with fixed, precision=0, and showpoint (#1417) 2019-11-24 08:23:10 -08:00
Victor Zverovich
43271ba8e8 Handle null terminator at the end of the buffer 2019-11-24 07:15:25 -08:00
Victor Zverovich
66d7746bb3 Use grisu for exponent notation 2019-11-19 16:55:11 -08:00
Leon Klingele
78842ce0d6 test: add default constructor for a const value
This fixed a compilation error of the OS X 10.11.6 C++ compiler:

    ./fmt/test/format-test.cc:1861:16: error: default initialization of an object of const type 'const Answer' without a user-provided default constructor
      const Answer const_answer;
                   ^
                               {}
2019-11-19 08:32:35 -08:00
Victor Zverovich
5420bcce2d Make % an opt-in to improve compatibility with std::format 2019-11-18 08:04:43 -08:00
Victor Zverovich
dcde089b4e Improve POSIX API detection 2019-11-15 07:28:02 -08:00
David P. Sicilia
2145a7bdcc Move has_formatter into the public fmt namespace. (#1407)
* Move has_formatter into the public fmt namespace.

This will allow users to do SFINAE-friendly checks for
the formattability of a type.

Fixes #1369
2019-11-14 07:08:24 -08:00
daniel
f1559e1d56 Use grouping() from locale for specifier 'n' 2019-11-05 07:22:12 +00:00
Attila Tajti
0889856d61 Fix UTF-8 truncation 2019-11-03 11:53:15 +00:00
Victor Zverovich
213e09644f Workaround X11 madness (#1388) 2019-11-01 08:47:11 -07:00
Victor Zverovich
d39ebf3ff2 Optimize counting 2019-10-21 06:57:42 -07:00
Victor Zverovich
8498bc97dd Initialize all the things 2019-10-20 17:53:18 -07:00
Orivej Desh
a1079e9fd6 Fix undefined in format-test (#1349)
When `MoveCtor` performs `check_move_buffer`, the buffer allocator becomes null,
but then `MoveCtor` attempts to use it to allocate a dynamic buffer. This
succeeds nevertheless because a typical `std::allocator<char>::allocate` does
not use `this`, so it does not crash when `this` is null.

Fixes #1344
2019-10-08 15:42:51 -07:00
Victor Zverovich
c85ae23c73 Add max_value 2019-09-08 09:21:30 -07:00
Victor Zverovich
f7a4b4ab91 Make numeric alignment optional 2019-09-06 09:43:53 -07:00
Victor Zverovich
611cf0b3c6 Format octal 0 as 0 2019-09-06 07:03:47 -07:00
Victor Zverovich
1882b9687b Reduce the numer of ifdefs with an empty (u)int128_t fallback 2019-09-05 18:03:47 -07:00
Deniz Evrenci
6de0454b42 Add support for built-in __int128 when available 2019-09-04 07:05:08 -07:00
Victor Zverovich
422e7b9d70 Fix compile-time checks for user-defined types (#1292) 2019-08-31 08:35:38 -07:00
Victor Zverovich
c76957565c FixedEnum -> StrongEnum and make it a regression test 2019-08-31 08:16:47 -07:00
Egor Seredin
bcd9b9331a Map not int enum to correct underlying_type (#1286)
* Map not int enum to correct underlying_type

* Use non-zero constant in TestFixedEnum
2019-08-31 06:25:38 -07:00
Victor Zverovich
3f75e2b69e Make buffer_range public and update custom formatting docs (#1281) 2019-08-28 06:50:20 -07:00
Victor Zverovich
c1e97392be Fix warnings 2019-08-11 08:44:12 -07:00
Jack Andersen
699fe8e711 Remove const qualification in compile-time checks 2019-07-15 09:20:16 +02:00
Victor Zverovich
e4f84ee1c6 Refactor format_specs for #1109 and #940
Refactor `format_specs` and related APIs to support variable-width fill
(#1109), improve naming consistency, remove legacy setters (#940), and
optimize layout.
2019-07-06 20:57:40 -07:00
Victor Zverovich
bc14c6ee20 Use the decimal point from locale 2019-07-03 17:55:00 -07:00
Victor Zverovich
c9d5a08ed8 Add the 'n' float format specifier 2019-07-03 16:36:23 -07:00
Victor Zverovich
ded0a3bb3d Internalize undocumented basic_writer 2019-07-03 10:01:03 -07:00
Victor Zverovich
ab0ba8a9d0 Don't emit decimal point if there are no trailing digits (#1210) 2019-06-30 08:44:59 -07:00
Victor Zverovich
260c115908 Fix formatting of 0.0 with (#1210) 2019-06-30 06:54:41 -07:00
Victor Zverovich
72e519a4bd Add formatter<std::string_view> 2019-06-22 20:26:28 -07:00
Victor Zverovich
f13906f408 back_insert_range<internal::buffer> -> buffer_range 2019-06-19 14:12:29 -07:00
Victor Zverovich
4912cff65d Fix handling of mapped types in compile checks (#1200) 2019-06-16 16:06:06 -07:00
Victor Zverovich
874d6727e4 Remove workarounds for pre-C++11 compilers 2019-06-13 20:56:08 -07:00
Victor Zverovich
cbbee1b385 Fix handling of hexfloat 2019-06-12 20:53:01 -07:00
Victor Zverovich
d05d42751c Remove old msvc workaround from arg_formatter_base and fix warning 2019-06-12 19:27:23 -07:00
Victor Zverovich
d32fe0f3f6 Fix hadling of nullptr 2019-06-12 09:22:36 -07:00
Victor Zverovich
cb4c59495e Deprecate convert_to_int 2019-06-07 13:38:08 -07:00
Victor Zverovich
40779749ac is_formattable -> has_formatter 2019-06-07 06:51:21 -07:00
Victor Zverovich
3fdba04924 Reduce the number of nontrivial formatter instantiations 2019-06-06 22:02:53 -07:00
Victor Zverovich
eddb84cfc0 Fix formatting of exotic characters 2019-06-03 17:08:00 -07:00
Victor Zverovich
d07cc2026b FMT_EXPLICIT -> explicit, FMT_NULL -> nullptr 2019-05-30 07:42:36 -07:00
Victor Zverovich
afc571aedc Document join and relax its compiler requirements 2019-05-29 11:21:05 -07:00
Victor Zverovich
67179dbc23 Remove deprecated format_decimal 2019-05-15 10:34:38 -07:00
denchat
f4dfd6e30f Suppress all clang-target-msvc test warning in CMake and other misc fixes (#1151)
* Fix conditional `char8_t` from `format.h` and fix `-Wunused-result` of [[no_discard]] begin() when in c++17

* Suppress `-Winconsistent-dllimport` when in clang-target-msvc

* Suppress warning _CRT_SECURE_NO_WARNINGS in MSVC and -Wdeprecated-declarations

Suppress warning _CRT_SECURE_NO_WARNINGS in MSVC and -Wdeprecated-declarations of POSIX functions in Clang target MSVC.
Those functions are used by gtest.

* Remove FMT_FUNC, mark FMT_API to export
2019-05-11 11:48:27 -07:00
Victor Zverovich
ea2976e6d5 Move internal::uintptr_t test to format-impl-test (#1152) 2019-05-11 06:58:22 -07:00
denchat
3fd134be03 Move test_count_digits to format-impl-test and disable gtest warnings (#1147)
* This translation unit includes `gtest.h` in which using something like `strncpy`

Suppress MSVC warnings from `gtest.h` included.

Warning sample:
fmt-master\test\gtest\gtest.h(2873,10): warning: 'strncpy' is deprecated: This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]

* Moving `test_count_digits` to format-impl-test then count_digits<4>(internal::uintptr_t) shall not be exported

* retaining _CRT_SECURE_NO_WARNINGS always defined should be no harms.
2019-05-07 12:09:11 -07:00
Victor Zverovich
40a7975640 Remove trailing zeros 2019-04-27 07:42:27 -07:00
Victor Zverovich
cb46397dfb Fix typo 2019-04-27 07:13:35 -07:00
Victor Zverovich
134904c886 Re-enabled constexpr tests 2019-04-26 17:07:37 -07:00
HE, Tao
6b20863918 fmt::ptr: support unique_ptr and shared_ptr. 2019-04-18 10:12:11 -07:00
Victor Zverovich
d306585a3f Don't inject internal names into std (#1120) 2019-04-17 13:25:31 -07:00
Victor Zverovich
dc94010fa5 Remove char_traits (#1117) 2019-04-16 17:08:24 -07:00
Victor Zverovich
5d755d0a4e Fix handling of volatile char (#1115) 2019-04-14 12:34:56 -07:00
Victor Zverovich
2808395481 basic_buffer -> buffer
This reduces symbol sizes and gets rid of shadowing warnings.
2019-04-07 20:32:28 -07:00
Victor Zverovich
f10a7e2e46 Test exotic pointer formatting 2019-04-06 09:04:44 -07:00
Victor Zverovich
bd8177177a Add support for platforms without uintptr_t 2019-04-06 08:11:03 -07:00
mwinterb
7ad3015f5b Added missing typename to FMT_STRING. (#1089)
* Added missing typename to FMT_STRING.

This is so that FMT_STRING can be used in a template.
2019-03-20 20:37:00 -07:00
Victor Zverovich
294fd7df96 Remove isinf workaround 2019-03-17 14:49:19 -07:00
Victor Zverovich
97619e27a2 More fixed precision tests 2019-03-15 10:20:20 -07:00
Victor Zverovich
a82b3680dc More tests and fixed precision fixes 2019-03-13 19:47:07 -07:00
Victor Zverovich
e28429ee73 Prevent overflow with zero precision 2019-03-13 10:46:25 -07:00
Victor Zverovich
8407f4cb24 Round close to zero fixed precision 2019-03-09 15:18:34 -08:00
Victor Zverovich
49d244c065 Don't emit more than precision digits (#1072) 2019-03-09 13:53:23 -08:00
Michael Winterberg
d8434baa03 Declare the size of RESET_COLOR.
This is so that the format with a text_tyle will compile even if
header-only mode isn't enabled. Addresses #1063.
2019-03-06 09:41:45 -10:00
gawain
79b79f329e Add support for '%' type to output floating point values as a
percentage.

This helps with compatibility with Python's format strings.
2019-03-05 17:36:20 -08:00
Alexander Bolz
287eaab3b2 Increment output iterator in basic_writer::write for character types (#1056) 2019-02-26 12:16:34 -10:00
Victor Zverovich
442fa1bd46 Decouple format and parse contexts 2019-02-09 20:39:37 -08:00
Victor Zverovich
744e66bb08 Deprecate format_context::parse_context() 2019-02-09 16:15:20 -08:00
Victor Zverovich
355eb6d29a Enable grisu for shortest roundtrip (default) formatting 2019-02-03 10:38:28 -08:00
Elias Kosunen
7fbbfed8c6 Fix warnings caused by usage of deprecated functionality 2019-02-02 05:48:39 -08:00
Victor Zverovich
06c005b7b0 Clarify that compile-time checks don't support named arguments 2019-01-27 10:10:13 -08:00
Victor Zverovich
5f1ceebc7f Make formatter<T> override ostream<< for templates (#952) 2019-01-21 09:42:55 -08:00
Victor Zverovich
83f052930a Add code from p0645 2019-01-20 15:12:01 -08:00