forked from fmtlib/fmt
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebase master. #1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Otherwise breaks on compilers without noexcept support
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.
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
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 ```
The `operator()` member function of `std::is_same` was added in C++14. For C++11, the `::value` needs to be used instead.
## 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`
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`
* Fix formatting chrono durations to wide strings * Make format buffers const correct * Add FormatWide chrono test case * Fix incorrect wide encoding of 'µs' I think might be a source file encoding issue, so I used \u00B5 instead. * Update FormatWide test to use proper encoding of µs * Revert changes to format_localized's parameters * Use different overload of `std::time_put<T>::put` to avoid needing a format string * Use utf8_to_utf16 instead of having redundant overloads of get_units * Revert some minor changes * Remove FMT_CONSTEXPR from expression This should hopefully fix compilation on VS <2019 * Make suggested changes from code review * Run clang-format on chrono.h * Make sure unit isn't null before constructing a string_view from it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.