before this change, we rely on the default-generated fmt::formatter created from operator<<, but fmt v10 dropped the default-generated formatter. in this change, we define a formatter for db::operation_type, and remove their operator<<(). Refs #13245 Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes scylladb/scylladb#16832
27 lines
473 B
C++
27 lines
473 B
C++
/*
|
|
* Copyright (C) 2022-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <fmt/core.h>
|
|
|
|
namespace db {
|
|
|
|
enum class operation_type : uint8_t {
|
|
read = 0,
|
|
write = 1
|
|
};
|
|
|
|
}
|
|
|
|
template <> struct fmt::formatter<db::operation_type> {
|
|
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
|
|
auto format(db::operation_type, fmt::format_context& ctx) const -> decltype(ctx.out());
|
|
};
|