Clear moved from memory buffer

This commit is contained in:
Victor Zverovich
2022-02-20 08:12:19 -08:00
parent ea3d326c63
commit cbc59ca893
2 changed files with 5 additions and 3 deletions

View File

@@ -775,6 +775,7 @@ class basic_memory_buffer final : public detail::buffer<T> {
// Set pointer to the inline array so that delete is not called
// when deallocating.
other.set(other.store_, 0);
other.clear();
}
this->resize(size);
}
@@ -2896,7 +2897,7 @@ template <typename Enum, FMT_ENABLE_IF(std::is_enum<Enum>::value)>
constexpr auto format_as(Enum e) noexcept -> underlying_t<Enum> {
return static_cast<underlying_t<Enum>>(e);
}
}
} // namespace enums
#ifdef __cpp_lib_byte
inline auto format_as(std::byte b) -> unsigned char { return underlying(b); }