row_cache: pass "const cache_entry" to operator<<

operator<<(..) does not mutate the cache_entry parameter passed to it.
also, without this change fmtlib is not able to format given cache_entry
parameter, as the caller formatter has "const" specifier.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
Kefu Chai
2023-03-14 15:50:08 +08:00
committed by Kefu Chai
parent 5705df77a1
commit 9eb2626fec
2 changed files with 2 additions and 2 deletions

View File

@@ -1366,7 +1366,7 @@ future<> row_cache::do_update(row_cache::external_updater eu, row_cache::interna
});
}
std::ostream& operator<<(std::ostream& out, cache_entry& e) {
std::ostream& operator<<(std::ostream& out, const cache_entry& e) {
return out << "{cache_entry: " << e.position()
<< ", cont=" << e.continuous()
<< ", dummy=" << e.is_dummy_entry()

View File

@@ -141,7 +141,7 @@ public:
bool is_dummy_entry() const noexcept { return _flags._dummy_entry; }
friend std::ostream& operator<<(std::ostream&, cache_entry&);
friend std::ostream& operator<<(std::ostream&, const cache_entry&);
};
//