Commit Graph

220 Commits

Author SHA1 Message Date
Victor Zverovich
c21c6b8c4b Move enable_if to template params 2019-03-16 15:15:38 -07:00
Michael Lui
187bd1b8b2 Clarify lifetimes of named_arg parameters (#1051)
* Clarify usage of fmt::arg

Document that fmt::arg takes a non-owning
reference, even if that reference is to
a temporary. As such, users should make sure
the lifetime of the reference lasts as long
as the named argument.

* Clean up language

Remove mentions of `std::reference_wrapper` and rvalues
in favor of more common terminology like dangling references.
2019-02-22 06:37:19 -10:00
Victor Zverovich
c5aad69f2a Restore deprecated begin() 2019-02-15 15:00:02 -08:00
Victor Zverovich
83808076e3 Minor cleanup 2019-02-13 19:28:02 -08:00
Victor Zverovich
9660ea1bff Simplify format string checks 2019-02-10 18:00:19 -08:00
Victor Zverovich
f041f128f5 Minor cleanup 2019-02-10 15:20:40 -08:00
Victor Zverovich
e4572e5def Update std implementation 2019-02-10 07:56:33 -08: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
Daniela Engert
61c9b563c2 Replace 'std::result_of' by 'std::invoke_result' where possible (#1025)
C++17 deprecated 'std::result_of' in favour of 'std::invoke_result' and will ban it outright in C++20. Therefore
- implement 'internal::result_of' in terms of 'std::invoke_result' when compiling C++17 mode.
- implement 'internal::result_of' in terms of 'std::result_of' when compiling in modes C++11 or C++14.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2019-02-04 11:25:22 -08:00
Elias Kosunen
7fbbfed8c6 Fix warnings caused by usage of deprecated functionality 2019-02-02 05:48:39 -08:00
Elias Kosunen
34951f1999 Replace comments regarding deprecation with attributes 2019-02-02 05:48:39 -08:00
Victor Zverovich
3f52336e6c Simplify formatter selection 2019-01-30 19:39:42 -08:00
Victor Zverovich
7cdb1e5e40 Workaround broken is_default_constructible in MSVC 2019-01-21 10:54:49 -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
Victor Zverovich
dad1eec842 Workaround unimplemented T... on gcc 4.6.x (#1008) 2019-01-16 11:41:20 -08:00
Victor Zverovich
dde095fab8 Revert "Reorder defines"
This reverts commit 4a059914a9.
2019-01-13 08:13:38 -08:00
Victor Zverovich
4a059914a9 Reorder defines 2019-01-13 07:40:37 -08:00
Victor Zverovich
58b6f8db48 Format the code using clang-format 2019-01-13 06:58:20 -08:00
stryku
9a777b9e1c Implemented fmt::prepare()
Implementation of fmt::prepare() function and features around it.
2019-01-12 10:53:31 -08:00
Victor Zverovich
b3ad759a0a Bump version and correct changelog 2018-12-28 13:09:31 -08:00
Victor Zverovich
b34d92b051 Bump version 2018-12-28 12:23:29 -08:00
Victor Zverovich
84e5170c9c Update changelog and deprecate visit 2018-12-24 10:02:41 -08:00
Victor Zverovich
7f7504b3f5 Clean up docs 2018-12-12 18:21:13 -08:00
Victor Zverovich
ea5e4790bd Fix formatting 2018-12-03 08:58:48 -08:00
Johan J
e867768ee6 Do not override user provided compile flag 2018-12-03 07:31:19 -08:00
Daniela Engert
e7e2ab1070 Make return type of basic_format_args::max_size() consistent.
This squashes nasty narrowing conversion warnings.
2018-12-01 17:07:21 -08:00
Victor Zverovich
bcf3fcd673 Clean up bit fiddling for argument packing 2018-11-30 17:04:49 -08:00
Victor Zverovich
64690d3a97 Add context_base::arg() 2018-11-24 10:49:48 -08:00
Victor Zverovich
982ee5c699 parse_context -> format_parse_context 2018-11-21 07:10:22 -08:00
Victor Zverovich
6c95fb3562 Default Context to format_context 2018-11-18 07:19:25 -08:00
Victor Zverovich
f2ee988105 Improve locale support 2018-11-14 12:07:39 -08:00
Victor Zverovich
bdda4d6030 Simplify compile-time strings 2018-10-28 09:02:03 -07:00
XZiar
2dea780fbd change type naming and fix sfinae bug 2018-10-28 06:00:55 -07:00
XZiar
b98e8301d5 add non-char support for compile-time format check 2018-10-28 06:00:55 -07:00
Victor Zverovich
ccd3e8bbf3 Make is_constructible public (#918) 2018-10-27 17:10:19 -07:00
Victor Zverovich
0a96c032b9 Parameterize v*printf on string type (#920) 2018-10-25 13:52:08 -07:00
Victor Zverovich
61e6d2e38c Fix core version of vformat_to 2018-10-25 06:21:41 -07:00
Victor Zverovich
ea4010d704 Merge has_to_string_view into is_string 2018-10-24 18:16:00 -07:00
Victor Zverovich
486fff597c Add sprintf_format instantiations and remove syntactic noise 2018-10-24 16:46:32 -07:00
Victor Zverovich
f0328f8e36 Use char_traits::length in string_view ctor (#914) 2018-10-24 15:21:21 -07:00
Victor Zverovich
20c708bf6d Fix build on gcc 4.4 2018-10-24 10:52:02 -07:00
Daniela Engert
2c81c851b2 Adapt any string-like type to be used by {fmt} just like the standard string types already supported. The adaption is totally non-intrusive.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-10-22 18:25:52 -07:00
Daniela Engert
6a685571df Make 'std::*::basic_string_view' a valid argument type for 'format_str' parameters.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-10-08 06:12:02 -07:00
Victor Zverovich
655ce53383 is_format_string -> is_string 2018-10-07 12:45:22 -07:00
Daniela Engert
f16a118e88 Fix non-matching char types.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-10-07 05:56:21 -07:00
Victor Zverovich
041bf83d9b Improve fmt::format readability 2018-10-05 18:42:02 -07:00
Victor Zverovich
f5480635c0 visit -> visit_format_arg 2018-10-05 07:15:41 -07:00
Victor Zverovich
cdf3fa08dc Put related code together in fmt/core.h 2018-10-04 19:44:09 -07:00