Commit Graph

387 Commits

Author SHA1 Message Date
Victor Zverovich
3fdba04924 Reduce the number of nontrivial formatter instantiations 2019-06-06 22:02:53 -07:00
Victor Zverovich
a38b99a188 Fix a regression in named argument handling introduced by prepare 2019-06-05 16:50:04 -07:00
Victor Zverovich
388bb389e6 integral_constant -> bool_constant 2019-06-05 08:14:47 -07:00
Victor Zverovich
469a4bbd35 Use enable_if_t 2019-06-04 21:38:18 -07:00
Victor Zverovich
c264e641ea Add conditional_t for pre-C++14 2019-06-04 18:50:30 -07:00
Victor Zverovich
064ce6b6c0 Specialize is_char for character types 2019-06-04 17:08:58 -07:00
Victor Zverovich
eddb84cfc0 Fix formatting of exotic characters 2019-06-03 17:08:00 -07:00
mocabe
1653244c69 Fix compilation issue on VS2019 (#1186) (#1191) 2019-06-03 08:34:27 -07:00
Victor Zverovich
d54e64b3c8 Make buffer_context an alias template 2019-06-02 18:28:49 -07:00
Victor Zverovich
4d4b8c238d FMT_CHAR -> char_t 2019-06-02 15:03:37 -07:00
Victor Zverovich
67feef5589 Make enable_if_t more std-like and move to fmt namespace 2019-06-01 10:05:16 -07:00
Christopher Di Bella
c929684e33 inlines count_code_points(basic_string_view<char8_t)
count_code_points(basic_string_view<char8_t>) was defined in
fmt/format-inl.h, and only declared in fmt/format.h, but not defined
in src/format.cc. This commit moves the overload to fmt/format.h and
inlines it.
2019-06-01 07:17:22 -07:00
Victor Zverovich
f57227a148 FMT_ENABLE_IF -> enable_if_t 2019-05-31 20:09:19 -07:00
Victor Zverovich
8302c2f33b fmt::internal::declval -> std::declval 2019-05-30 09:46:10 -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
e3e470bb69 Remove deprecated format_decimal 2019-05-15 10:34:45 -07:00
Victor Zverovich
98b3775297 Add support for exotic string_view iterators (#1156) 2019-05-12 11:07:49 -07:00
Victor Zverovich
a6e8ed15c4 Disable UDL templates on GCC 9 by default (#1148) 2019-05-11 08:58:39 -07:00
Victor Zverovich
de5da50910 Fix formatting of extreme durations (#1154) 2019-05-11 08:42:02 -07:00
Alex Alabuzhev
77d6036cd5 Fix unexpected trailing decimal point (#1153) 2019-05-11 06:34:47 -07:00
mocabe
6828d549e8 Add FMT_ENABLE_IF_T
for definitions of functions which declared using FMT_ENABLE_IF
2019-05-08 11:20:55 -07:00
denchat
29c10fbf6e Fix DLL visibility of explicit instantiation "declaration" of internal::basic_data<void> in header format.h and the explicit instantiation "definition" in format.cc (#1134)
* Update format.cc

As the explicit instantiation *declaration* of `internal::basic_data<void>` in format.h, this explicit instantiation *definition* should mirror FMT_API also.

* Mirror visibility of explicit instantiation declaration 

explicit instantiation declaration of internal::basic_data<void> should mirror visibility of FMT_API

* Eliminate `__declspec(dllexport)` designation on extern template internal::basic_data<> when `extern` affected during exporting phase.

* Add `FMT_EXTERN_TEMPLATE_API` for designate DLL export `extern template`

When exporting DLL, do not designate `__declspec(dllexport)` any template that has any explicit class template declaration a.k.a. `extern template`. Instead, designate `__declspec(dllexport)` at single point where we have explicit class template definition a.k.a. normal instantiation without `extern`

Note: this is a c++11 feature.

* Delete whole `FMT_USE_EXTERN_TEMPLATES` block and its condition

1. Remove whole `FMT_USE_EXTERN_TEMPLATES` block
(trailing `FMT_UDL_TEMPLATE` block)
````
#ifndef FMT_USE_EXTERN_TEMPLATES
#  ifndef FMT_HEADER_ONLY
#    define FMT_USE_EXTERN_TEMPLATES                           \
      ((FMT_CLANG_VERSION >= 209 && __cplusplus >= 201103L) || \
       (FMT_GCC_VERSION >= 303 && FMT_HAS_GXX_CXX11))
#  else
#    define FMT_USE_EXTERN_TEMPLATES 0
#  endif
#endif
````

2. Delete `FMT_USE_EXTERN_TEMPLATES` condition, only condition, that trailing basic_data class template definition.
````
#if FMT_USE_EXTERN_TEMPLATES
extern template struct basic_data<void>;
#endif
````

3. Replace `FMT_API` with new `FMT_EXTERN_TEMPLATE_API` added in `core.h` for sake of extern template of `basic_data<void>`

* Add `#define FMT_EXTERN extern` only when not `FMT_HEADER_ONLY`

* Replace `extern` on basic_data<void> with the `FMT_EXTERN` condition in core.h

* replace misspelled if !define() with ifndef
2019-05-02 07:49:01 -07:00
Victor Zverovich
8d8ea21c69 Partially implement Grisu3 2019-04-27 12:17:21 -07:00
Victor Zverovich
40a7975640 Remove trailing zeros 2019-04-27 07:42:27 -07:00
Victor Zverovich
bd516e3429 Convert negative precision to zero in printf (#1127)
and remove redundant check in grisu2_prettify.
2019-04-21 07:44:04 -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
bade46aae5 Optimize grisu using uint128_t 2019-04-13 13:44:41 -07:00
Victor Zverovich
41fbaeb3b1 Add <format> test 2019-04-13 11:37:52 -07:00
Victor Zverovich
718f60accb Fix shadowing warning (#1105) and clang format 2019-04-08 19:14:32 -07:00
Bruce Mitchener
aeb5ad3ce1 Enable [[noreturn]] some. 2019-04-08 07:53:59 -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
07d5a86a7c Fix warnings 2019-04-06 22:10:10 -07:00
Victor Zverovich
ab1474ef66 Workaround segfault in doxygen and apply clang-format 2019-04-06 15:55:14 -07:00
Victor Zverovich
bd8177177a Add support for platforms without uintptr_t 2019-04-06 08:11:03 -07:00
Victor Zverovich
0302927f56 Optimize pointer formatting 2019-04-05 20:36:37 -07:00
Victor Zverovich
bb6842ba35 Simplify to_string 2019-04-05 19:15:22 -07:00
Victor Zverovich
b23c8633fa Detect presence of uintptr_t 2019-04-05 07:43:00 -07:00
Ivan Shynkarenka
e979c782d3 Extend basic_writer with write() method for doubles with optional format_specs argument 2019-03-25 19:16:41 -07:00
Victor Zverovich
91acfe6852 Fix UBSAN warning 2019-03-22 07:56:02 -07:00
Victor Zverovich
b7e6bf9671 clang format 2019-03-21 20:51:37 -07:00
Victor Zverovich
da0ea4161a Make compile-time checks work with fallback formatter (#1088) 2019-03-21 19:26:53 -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
bc784d3625 Remove isnan workaround 2019-03-17 12:23:36 -07:00
Victor Zverovich
76d326a2a2 Enable grisu for general format 2019-03-17 09:48:50 -07:00
Victor Zverovich
c21c6b8c4b Move enable_if to template params 2019-03-16 15:15:38 -07:00
Bruce Mitchener
4523053e6f Fix typos. 2019-03-10 07:49:33 -07:00