Commit Graph

381 Commits

Author SHA1 Message Date
Victor Zverovich e5512c5d57 Use static_assert instead of SFINAE in arg(...) 2019-05-29 13:21:24 -07:00
mocabe 118d8bccc2 Fix compilation error under MSVC 19.21 (#1140) 2019-05-08 11:20:55 -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 5d755d0a4e Fix handling of volatile char (#1115) 2019-04-14 12:34:56 -07:00
Victor Zverovich ccd70f59ee Workaround bogus unreachable warnings in MSVC 2019-04-11 17:59:35 -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 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
ricco19 6d416cf674 Forward declare is_string<FILE*> specializations 2019-03-19 05:20:18 -07:00
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