lib/fmt/ToBuffer: new library
This commit is contained in:
@@ -28,8 +28,7 @@
|
||||
*/
|
||||
|
||||
#include "FmtError.hxx"
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "lib/fmt/ToBuffer.hxx"
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -37,11 +36,8 @@ std::system_error
|
||||
VFmtSystemError(std::error_code code,
|
||||
fmt::string_view format_str, fmt::format_args args) noexcept
|
||||
{
|
||||
std::array<char, 512> buffer;
|
||||
auto [p, _] = fmt::vformat_to_n(buffer.begin(), buffer.size() - 1,
|
||||
format_str, args);
|
||||
*p = 0;
|
||||
return std::system_error{code, buffer.data()};
|
||||
const auto msg = VFmtBuffer<512>(format_str, args);
|
||||
return std::system_error{code, msg};
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
Reference in New Issue
Block a user