Merge branch 'develop' into collected_small_changes
This commit is contained in:
@ -23,10 +23,23 @@ coordinated.
|
||||
|
||||
----------
|
||||
|
||||
The content for this manual is part of the LAMMPS distribution. The
|
||||
online version always corresponds to the latest feature release version.
|
||||
If needed, you can build a local copy of the manual as HTML pages or a
|
||||
PDF file by following the steps on the :doc:`Build_manual` page. If you
|
||||
The content for this manual is part of the LAMMPS distribution in its
|
||||
doc directory.
|
||||
|
||||
* The version of the manual on the LAMMPS website corresponds to the
|
||||
latest LAMMPS feature release. It is available at:
|
||||
`https://docs.lammps.org/ <https://docs.lammps.org/>`_.
|
||||
* A version of the manual corresponding to the latest LAMMPS stable
|
||||
release (state of the *stable* branch on GitHub) is available online
|
||||
at: `https://docs.lammps.org/stable/
|
||||
<https://docs.lammps.org/stable/>`_
|
||||
* A version of the manual with the features most recently added to
|
||||
LAMMPS (state of the *develop* branch on GitHub) is available at:
|
||||
`https://docs.lammps.org/latest/ <https://docs.lammps.org/latest/>`_
|
||||
|
||||
If needed, you can build a copy on your local machine of the manual
|
||||
(HTML pages or PDF file) for the version of LAMMPS you have
|
||||
downloaded. Follow the steps on the :doc:`Build_manual` page. If you
|
||||
have difficulties viewing the pages, please :ref:`see this note
|
||||
<webbrowser>`.
|
||||
|
||||
|
||||
@ -1429,9 +1429,8 @@ template <typename Context> struct arg_mapper {
|
||||
FMT_ENABLE_IF(
|
||||
std::is_pointer<T>::value || std::is_member_pointer<T>::value ||
|
||||
std::is_function<typename std::remove_pointer<T>::type>::value ||
|
||||
(std::is_convertible<const T&, const void*>::value &&
|
||||
!std::is_convertible<const T&, const char_type*>::value &&
|
||||
!has_formatter<T, Context>::value))>
|
||||
(std::is_array<T>::value &&
|
||||
!std::is_convertible<T, const char_type*>::value))>
|
||||
FMT_CONSTEXPR auto map(const T&) -> unformattable_pointer {
|
||||
return {};
|
||||
}
|
||||
@ -1671,7 +1670,6 @@ template <typename Context> class basic_format_arg {
|
||||
\endrst
|
||||
*/
|
||||
// DEPRECATED!
|
||||
FMT_EXPORT
|
||||
template <typename Visitor, typename Context>
|
||||
FMT_CONSTEXPR FMT_INLINE auto visit_format_arg(
|
||||
Visitor&& vis, const basic_format_arg<Context>& arg) -> decltype(vis(0)) {
|
||||
|
||||
@ -83,7 +83,8 @@
|
||||
# if FMT_CPLUSPLUS >= 202002L
|
||||
# if FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
|
||||
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
|
||||
# elif FMT_MSC_VERSION >= 1929 // VS2019 v16.10 and later
|
||||
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485)
|
||||
# elif (FMT_MSC_VERSION >= 1929) && !FMT_CLANG_VERSION
|
||||
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
|
||||
# endif
|
||||
# endif
|
||||
@ -368,8 +369,6 @@ class uint128_fallback {
|
||||
private:
|
||||
uint64_t lo_, hi_;
|
||||
|
||||
friend uint128_fallback umul128(uint64_t x, uint64_t y) noexcept;
|
||||
|
||||
public:
|
||||
constexpr uint128_fallback(uint64_t hi, uint64_t lo) : lo_(lo), hi_(hi) {}
|
||||
constexpr uint128_fallback(uint64_t value = 0) : lo_(value), hi_(0) {}
|
||||
@ -1038,6 +1037,7 @@ namespace detail {
|
||||
FMT_API bool write_console(std::FILE* f, string_view text);
|
||||
FMT_API void print(std::FILE*, string_view);
|
||||
} // namespace detail
|
||||
|
||||
FMT_BEGIN_EXPORT
|
||||
|
||||
// Suppress a misleading warning in older versions of clang.
|
||||
@ -1387,8 +1387,8 @@ FMT_CONSTEXPR auto format_uint(Char* buffer, UInt value, int num_digits,
|
||||
}
|
||||
|
||||
template <unsigned BASE_BITS, typename Char, typename It, typename UInt>
|
||||
inline auto format_uint(It out, UInt value, int num_digits, bool upper = false)
|
||||
-> It {
|
||||
FMT_CONSTEXPR inline auto format_uint(It out, UInt value, int num_digits,
|
||||
bool upper = false) -> It {
|
||||
if (auto ptr = to_pointer<Char>(out, to_unsigned(num_digits))) {
|
||||
format_uint<BASE_BITS>(ptr, value, num_digits, upper);
|
||||
return out;
|
||||
@ -1453,7 +1453,7 @@ template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
|
||||
++p;
|
||||
if (p == s.end() || (c & 0xfc00) != 0xd800 || (*p & 0xfc00) != 0xdc00) {
|
||||
if (policy == to_utf8_error_policy::abort) return false;
|
||||
buf.append(string_view("<EFBFBD>"));
|
||||
buf.append(string_view("\xEF\xBF\xBD"));
|
||||
--p;
|
||||
} else {
|
||||
c = (c << 10) + static_cast<uint32_t>(*p) - 0x35fdc00;
|
||||
@ -1486,9 +1486,9 @@ inline uint128_fallback umul128(uint64_t x, uint64_t y) noexcept {
|
||||
auto p = static_cast<uint128_opt>(x) * static_cast<uint128_opt>(y);
|
||||
return {static_cast<uint64_t>(p >> 64), static_cast<uint64_t>(p)};
|
||||
#elif defined(_MSC_VER) && defined(_M_X64)
|
||||
auto result = uint128_fallback();
|
||||
result.lo_ = _umul128(x, y, &result.hi_);
|
||||
return result;
|
||||
auto hi = uint64_t();
|
||||
auto lo = _umul128(x, y, &hi);
|
||||
return {hi, lo};
|
||||
#else
|
||||
const uint64_t mask = static_cast<uint64_t>(max_value<uint32_t>());
|
||||
|
||||
@ -4287,7 +4287,8 @@ auto join(Range&& range, string_view sep)
|
||||
std::string answer = fmt::to_string(42);
|
||||
\endrst
|
||||
*/
|
||||
template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
|
||||
template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value &&
|
||||
!detail::has_format_as<T>::value)>
|
||||
inline auto to_string(const T& value) -> std::string {
|
||||
auto buffer = memory_buffer();
|
||||
detail::write<char>(appender(buffer), value);
|
||||
@ -4312,6 +4313,14 @@ FMT_NODISCARD auto to_string(const basic_memory_buffer<Char, SIZE>& buf)
|
||||
return std::basic_string<Char>(buf.data(), size);
|
||||
}
|
||||
|
||||
template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value &&
|
||||
detail::has_format_as<T>::value)>
|
||||
inline auto to_string(const T& value) -> std::string {
|
||||
return to_string(format_as(value));
|
||||
}
|
||||
|
||||
FMT_END_EXPORT
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <typename Char>
|
||||
@ -4383,6 +4392,8 @@ void vformat_to(buffer<Char>& buf, basic_string_view<Char> fmt,
|
||||
detail::parse_format_string<false>(fmt, format_handler(out, fmt, args, loc));
|
||||
}
|
||||
|
||||
FMT_BEGIN_EXPORT
|
||||
|
||||
#ifndef FMT_HEADER_ONLY
|
||||
extern template FMT_API void vformat_to(buffer<char>&, string_view,
|
||||
typename vformat_args<>::type,
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#ifndef FMT_STD_H_
|
||||
#define FMT_STD_H_
|
||||
|
||||
#include <atomic>
|
||||
#include <bitset>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
@ -435,6 +436,30 @@ struct formatter<BitRef, Char,
|
||||
}
|
||||
};
|
||||
|
||||
FMT_END_NAMESPACE
|
||||
FMT_EXPORT
|
||||
template <typename T, typename Char>
|
||||
struct formatter<std::atomic<T>, Char,
|
||||
enable_if_t<is_formattable<T, Char>::value>>
|
||||
: formatter<T, Char> {
|
||||
template <typename FormatContext>
|
||||
auto format(const std::atomic<T>& v, FormatContext& ctx) const
|
||||
-> decltype(ctx.out()) {
|
||||
return formatter<T, Char>::format(v.load(), ctx);
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef __cpp_lib_atomic_flag_test
|
||||
FMT_EXPORT
|
||||
template <typename Char>
|
||||
struct formatter<std::atomic_flag, Char>
|
||||
: formatter<bool, Char> {
|
||||
template <typename FormatContext>
|
||||
auto format(const std::atomic_flag& v, FormatContext& ctx) const
|
||||
-> decltype(ctx.out()) {
|
||||
return formatter<bool, Char>::format(v.test(), ctx);
|
||||
}
|
||||
};
|
||||
#endif // __cpp_lib_atomic_flag_test
|
||||
|
||||
FMT_END_NAMESPACE
|
||||
#endif // FMT_STD_H_
|
||||
|
||||
Reference in New Issue
Block a user