Commit Graph

4007 Commits

Author SHA1 Message Date
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
dspc-douglas
9fc4161f5e fix interal compiler error when building with mingw 2020-01-22 18:14:46 -08:00
Greg Sjaardema
25d6916b3a Fix so can work without locale defined
If `FMT_STATIC_THOUSANDS_SEPARATOR` defined, then locale is not included or defined, so this call will be unresolved.  I think this is the correct fix based on the code in `format-inl.h` and `format.h`
2020-01-22 07:26:03 -08:00
Victor Zverovich
0b2eb6501c Add locale example 2020-01-20 08:42:16 -08:00
Victor Zverovich
fd1cabe464 Workaround a bogus MSVC warning 2020-01-20 06:56:22 -08:00
Victor Zverovich
a844d7ab81 Add namespaces 2020-01-19 19:20:48 -08:00
Victor Zverovich
47d3968092 Add more examples 2020-01-19 19:15:54 -08:00
Victor Zverovich
7800173eb1 Update fill docs 2020-01-19 18:57:32 -08:00
Victor Zverovich
b4218aa0f8 Test invalid fill 2020-01-19 16:52:36 -08:00
Victor Zverovich
8a3a8177d6 Bump version 2020-01-19 15:34:30 -08:00
Victor Zverovich
e5f2f8ce7a Add variable-width fill support (#1109) 2020-01-19 14:49:51 -08:00
Victor Zverovich
75765bfad5 Avoid unnecessary unsigned overflows (#1515) 2020-01-18 08:19:27 -08:00
Victor Zverovich
9bd9738da0 Remove static and simplify names 2020-01-18 07:43:59 -08:00
Victor Zverovich
bd5f903f28 Add a locale example 2020-01-18 07:11:45 -08:00
Victor Zverovich
06e437fd98 Move docs to the proper place 2020-01-18 06:59:21 -08:00
JackBoosY
1bd4f54fa6 update format 2020-01-17 11:07:55 -08:00
JackBoosY
11cc2903e4 re-fix url link 2020-01-17 11:07:55 -08:00
JackBoosY
b124e3e8e7 fix url link 2020-01-17 11:07:55 -08:00
JackBoosY
ffd5f3469f Correct display format 2020-01-17 11:07:55 -08:00
JackBoosY
0f0e5ddf5f Add vcpkg installation instructions 2020-01-17 11:07:55 -08:00
Victor Zverovich
1f110702a1 Remove redundant braces 2020-01-15 15:07:30 -08:00
Jason Turner
4ccbe4b5f2 Avoid namespace clash for fmt
## Problem

In the case of an existing `fmt` namespace (in my project this looks like `Project::fmt`) it is possible to get a namespace clash in debug builds (MSVC 2017)

## Proposed Solution

When referencing `fmt` internally, be explicit that it is relative to the global namespace using `::fmt`
2020-01-15 11:23:24 -08:00
Greg Sjaardema
40638a75b3 Use C++11 compatible std::is_same operations
The `operator()` member function of `std::is_same` was added in C++14.  For C++11, the `::value` needs to be used instead.
2020-01-15 11:20:47 -08:00
Victor Zverovich
c8dd9cc99d Use type_identity to block unnecessary template argument deduction (thanks Tim Song) 2020-01-15 10:27:50 -08:00
Greg Sjaardema
4bbe57cebf Work-around for nvcc
The nvcc compiler (at least up to 9.2) defines `__SIZEOF_INT128__`, but doesn't support 128-bit integers on device code:
```
error: "fmt::v6::format_arg_store<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char>>, char>, const char *, int, const char *>" contains a 128-bit integer, which is not supported in device code
```
2020-01-15 07:31:58 -08:00
Greg Sjaardema
55b6130055 Use C++11-compatible operations
The `std::is_base_of<T,U>()` and `std::is_reference<T>()` member functions were added in C++14.  To maintain C++11 compatibility, use the `::value` instead.

Current code fails on intel-17 and other compilers if using strict C++11
2020-01-15 07:23:39 -08:00
Greg Sjaardema
ae3ea156ea Fix for older versions of intel compiler
The intel-17 and intel-18 compilers seem to require that `u` be `const`:
```
/src/fmt/format.h(226): warning #437: reference to local variable of enclosing function is not allowed
        char data[sizeof(u)];
```
If `u` is declared as `const auto u =1u` instead of just `auto u=1u`, the file compiles with no warnings.
2020-01-14 17:56:06 -08:00
Tobias Hammer
77165fdf85 Use FMT_NOEXCEPT instead of noexcept directly
Otherwise breaks on compilers without noexcept support
2020-01-14 09:31:31 -08:00
Victor Zverovich
65ac626c58 Improve join docs 2020-01-12 07:26:16 -08:00
torsten
cd0b3f9695 check if _SECURE_SCL is defined not equal to 0 2020-01-09 15:01:48 -08:00
Victor Zverovich
cef1e4354b Optimize grisu_gen_digits 2020-01-07 16:11:18 -10:00
Victor Zverovich
0201c8db21 Restructure float_format 2020-01-07 14:41:30 -10:00
Victor Zverovich
9e3f3e8cff Fix handling of output iterators in format_to_n (#1506) 2020-01-05 09:59:01 -10:00
Victor Zverovich
aa07c57654 Move vprint_mojibake to the internal namespace 2020-01-04 08:31:18 -10:00
Victor Zverovich
a73d89e9c7 Catch invalid uses of fmt::arg 2020-01-04 07:11:35 -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
b3fd0005dd Suppress a bogus -Wdouble-promotion warning 2020-01-03 06:57:14 -10:00
Victor Zverovich
7b478f9dec Simplify example 2020-01-02 07:31:45 -10:00
Victor Zverovich
c85efef312 More showpoint fixes and tests (#1498) 2019-12-30 13:08:35 -10:00
Victor Zverovich
455a7c0787 Clarify lifetime of basic_format_args 2019-12-30 08:51:47 -10:00
Victor Zverovich
674c326d7c
Update syntax.rst 2019-12-29 07:25:34 -10:00
Victor Zverovich
061a9897fe
Update syntax.rst 2019-12-26 16:49:40 -10:00
Ivan Shynkarenka
d2d1c9c560 warning C4267: 'argument': conversion from 'size_t' to 'DWORD', possible loss of data 2019-12-26 08:07:24 -08:00
Victor Zverovich
b6e19e5953 Update apidoc 2019-12-24 12:08:37 -08: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
5390e29d42 Enable mojibake 2019-12-24 08:42:29 -08:00
Victor Zverovich
9f6434dcde Improve UTF-8 handling on Windows 2019-12-23 16:19:11 -08:00
Victor Zverovich
dac9a7f99d Improve UTF-8 handling on Windows 2019-12-22 12:05:28 -08:00