Commit Graph

157 Commits

Author SHA1 Message Date
5chmidti
8a4bec5cf5 fix ambiguous formatter lookup for flat_set (#3561) 2023-07-31 09:26:33 -07:00
Victor Zverovich
c98e5a08a4 Fix modular build on clang 2023-04-10 12:07:25 -07:00
Victor Zverovich
1d0257e4c0 FMT_MODULE_EXPORT_* -> FMT_EXPORT_* 2023-04-10 08:33:39 -07:00
Björn Schäpers
7f46cb75b8 ranges: Fix extra semi (#3374) 2023-04-06 08:31:07 -07:00
Victor Zverovich
19c074e477 Remove deprecated fallback formatter 2023-03-26 08:45:06 -07:00
Shawn Zhong
cbc7b8d5c1 Cleanup dead variable (#3338) 2023-03-10 09:17:43 -08:00
Victor Zverovich
e0748e61dd Fix recursion check in range formatting 2023-03-04 08:20:32 -08:00
Victor Zverovich
76f520835f Call element parse in tuple parse 2023-02-20 12:54:20 -08:00
Victor Zverovich
507c3042d8 class -> typename 2023-02-18 10:23:42 -08:00
Victor Zverovich
1741e90dec Always call parse in range formatter 2023-02-18 09:58:37 -08:00
Victor Zverovich
655046d24f Fix container adaptor formatting 2023-02-10 09:45:37 -08:00
Shawn Zhong
581c6292c9 Add formatters for container adapters (#3279) 2023-02-08 17:25:41 -08:00
Barry Revzin
05e3a9233a Allowing formatting non-copyable ranges. (#3290) 2023-01-27 12:29:57 -08:00
Victor Zverovich
3e762fdf5c Use ignore_unused 2022-12-26 06:57:21 -08:00
Victor Zverovich
79981a2528 Cleanup ranges formatting 2022-12-25 20:05:20 -08:00
Shawn Zhong
fc96938345 Remove empty semicolon 2022-12-24 09:54:55 -08:00
Victor Zverovich
fae6f7e081 Optimize range formatter 2022-11-26 08:50:46 -08:00
Barry Revzin
66d71a1b35 Fixing formatting of range of range of char. (#3158) 2022-11-02 11:04:54 -07:00
Victor Zverovich
aec3bb5d0a Workaround C complex.h idiocy 2022-09-03 06:35:55 -07:00
Victor Zverovich
4a8e2949bb Fix formatting of ranges of code unit types
Thanks Nicole Mazzuca.
2022-08-26 13:48:58 -07:00
Vladislav Shchapov
36a25d75b4 Reuse detail::string_literal in the chrono formatter
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-05 06:15:59 -07:00
Vladislav Shchapov
6c6b1fbf6e Workaround a bug in MSVC
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-02 06:46:02 -07:00
Barry Revzin
0b2862a1e4 Range formatter (#2983)
* Implement range_formatter and format_kind

* Attempted gcc 4.8 fix

* gcc 4.8 interprets inaccessible as a hard error (instead of... not available)

* Attempting to delete set_debug_format.

* clang-format

* Different implementation of FMT_STATICALLY_WIDEN

* Renaming copy_str_range to copy_str.

* I guess I need a definition

* Forgot to delete these.

* Other PR comments.
2022-07-29 13:55:16 -07:00
Barry Revzin
92d36e82c4 The n specifier for ranges (#2981)
* The n specifier for ranges.

* Flipping flag polarity.
2022-07-12 10:08:38 -07:00
Daniel Krügler
e1d3d3a326 Exclude recursive ranges from the formatter specialization for ranges (#2974)
* 2954: Add test case

* Eliminate extra-test and merge it into existing std-test instead. Add conditionals for filesystem::path testing that does not run into the ambiguity problem.

* #2968: Introduce additional compile-time predicate to detect recursive ranges and reject them in formatter specialization for ranges. In addition, introduce additional wrapper traits for the individual logical operands of the complete range constraints

* #2968: Eliminate preprocessor condition that enables the formatter specialization for std::filesystem::path

* #2968: Eliminate preprocessor condition that enables the test for the formatter specialization for std::filesystem::path

* Use own bool_constant, which is available for all C++ versions

* Reintroduce previous workaround but restrict to VS 2015 for now

* Comma fix

* - Rename is_not_recursive_range to is_nonrecursive_range and add comment that explains it being depending on is_range being true
- Merge has_fallback_formatter_delayed into is_formattable_delayed and add comment that explains it being depending on is_not_recursive_range being true
- Replace disjunction in formatter specialization by has_fallback_formatter_delayed
- Get rid of unneeded detail:: prefixes within namespace detail
2022-07-10 06:26:23 -07:00
Daniel Krügler
d2a2320820 Fix partial specialization problem for filesystem for Visual Studio (#2957)
* #2954: Provide std::conjunction and std::disjunction substitutes

* #2954: Use conjunction and disjunction substitute to make formatter specializations for ranges and maps more robust (especially for Visual Studio compiler family)

* #2954: As workaround for older MSVC compilers split formatter<std::filesystem::path> partial template specialization into two explicit specialization.

* 2954: Add test case

* Provide simplified implementations of conjunction and disjunction

* Remove workaround explicit specializations if the partial specialization would cause an ambiguity error

* Eliminate extra-test and merge it into existing std-test instead. Add conditionals for filesystem::path testing that does not run into the ambiguity problem.
2022-07-03 11:06:54 -07:00
Jonathan W
e8bd2a804d Fix enable_ifs for map formatter (#2944) 2022-06-23 08:24:11 -07:00
jehelset
5682338891 Fix is_formattable for tuple-like types. (#2940) 2022-06-19 08:25:58 -07:00
Victor Zverovich
1761e2666a Remove FMT_CONSTEXPR_DECL 2022-05-29 16:42:58 -07:00
Victor Zverovich
c83a5d42bb FMT_MSC_VER -> FMT_MSC_VERSION 2022-05-29 15:39:08 -07:00
Victor Zverovich
edeb3d8091 Remove deprecated APIs 2022-05-21 19:57:38 -07:00
Riccardo Brugo
a8fe8becf4 Fix compilation error for ranges with ADL begin/end (#2807)
* Use `range_begin`/`end` to get formatted range iterators

* Add test for adl `begin`/`end`

* Apply clang-format

* Simplify tests
2022-03-11 11:36:39 -08:00
Barry Revzin
0cef1f819e Fixing formatting of certain kinds of ranges of ranges. (#2787)
* Fixing formatting of certain kinds of ranges of ranges.

* Renaming const_range to range_type.
2022-03-04 16:21:00 -08:00
Vladislav Shchapov
c71b070168 Add missing const qualifier (#2755) 2022-02-10 10:51:32 -08:00
Barry Revzin
a34a97cc1d Supporting ? as a string presentation type (#2674)
* Supporting ? as a string presentation type.

* Supporting ? as a char presentation type.

* Adding iterator_category to counting_iterator.
2022-01-30 08:55:28 -08:00
Victor Zverovich
c28500556a FMT_NOEXCEPT -> noexcept 2022-01-20 16:55:47 -08:00
Victor Zverovich
3c98f1a4cd Comment style 2022-01-08 09:52:39 -08:00
Barry Revzin
6e0f1399d7 Supporting nested format specs for ranges. (#2673)
* Supporting nested format specs for ranges.

* I dedicate this commit to Eric Niebler.

* clang-format

* PR comments.

* throw -> FMT_THROW

* Need to map every element too.

* Clarifying uncvref_type

* Trying to add a workaround for MSVC.
2022-01-08 09:48:26 -08:00
Victor Zverovich
bb69201578 Fix tuple join 2021-12-29 14:46:45 -08:00
Victor Zverovich
9c0c1bcdbd Simplify tuple formatting 2021-12-29 08:03:12 -08:00
Victor Zverovich
796662a612 Escape range items convertible to std::string_view 2021-12-27 09:38:06 -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
2fe94ad7e3 Make specifiers support in tuple_join an opt-in 2021-09-05 07:34:06 -07:00
Victor Zverovich
60cd5ea3f2 Add support for more formattable types in ranges 2021-09-03 14:55:41 -07:00
Pierre-Antoine Lacaze
d58d19ba32 Fix an odr violation in ranges.h (#2483)
* Add a testcase demonstrating ODR violation in ranges.h

* Fix ODR violation in ranges.h

* Fix comments

Co-authored-by: Pierre-Antoine Lacaze <pa.lacaze@gmail.com>
2021-09-02 08:47:44 -07:00
Victor Zverovich
34caecd6b6 Use consistent initialization style 2021-08-23 10:10:56 -07:00
sunmy2019
a44c8f651b reimplement formatter<tuple_join_view> (#2457)
* reimplement `formatter<tuple_join_view>`

1. completely reimplement `formatter<tuple_join_view<Char, T...>, Char>`
2. Add some tests

* use FMT_THROW
2021-08-23 09:51:19 -07:00
Victor Zverovich
2207ea0b36 More escaping 2021-08-22 16:54:26 -07:00
Victor Zverovich
a212ff757f Escape invalid code points 2021-08-22 15:51:33 -07:00