From 462e5e4b51cbfaec227e0e67575f507efc348aa6 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 18 Jan 2022 21:53:51 +0100 Subject: [PATCH] Fix example for iterating range One must use `equal_range` here, otherwise the iteration will not stop after the last matching key. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be157cd..72976ff 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ In the more interesting case where we inserted more DNS records, we could iterate over all items with `domain_id = 4` as follows: ``` -for(auto iter = txn.find<1>(4): iter != txn.end(); ++iter) { +for(auto [iter, end] = txn.equal_range<1>(4): iter != end; ++iter) { cout << iter->qname << "\n"; } ```