From 586e25c48ceb81372f347345f2870ed141f99477 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 31 Oct 2020 18:22:48 +0300 Subject: [PATCH] mdbx++: add `operator<<(ostream, pair_result)`. Change-Id: I44cc28f7f4f7d65225239d62f5bb8a15a8de16a8 --- mdbx.h++ | 1 + src/mdbx.c++ | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mdbx.h++ b/mdbx.h++ index dcdb3303..c1b29a26 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -2679,6 +2679,7 @@ public: LIBMDBX_API ::std::ostream &operator<<(::std::ostream &, const slice &); LIBMDBX_API ::std::ostream &operator<<(::std::ostream &, const pair &); +LIBMDBX_API ::std::ostream &operator<<(::std::ostream &, const pair_result &); template inline ::std::ostream &operator<<(::std::ostream &out, const buffer &it) { diff --git a/src/mdbx.c++ b/src/mdbx.c++ index f21deaa0..6f3f2e30 100644 --- a/src/mdbx.c++ +++ b/src/mdbx.c++ @@ -1297,6 +1297,11 @@ __cold ::std::ostream &operator<<(::std::ostream &out, const pair &it) { return out << "{" << it.key << " => " << it.value << "}"; } +__cold ::std::ostream &operator<<(::std::ostream &out, const pair_result &it) { + return out << "{" << (it.done ? "done: " : "non-done: ") << it.key << " => " + << it.value << "}"; +} + __cold ::std::ostream &operator<<(::std::ostream &out, const ::mdbx::env::geometry::size &it) { switch (it.bytes) {