From 17238aac61836e2351509903a7c73fe67aa9ca71 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 30 Jun 2026 09:10:19 +0200 Subject: [PATCH] :memo: fix documentation Closes #4354: fix "Custom data source" example Signed-off-by: Niels Lohmann --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 60ec6c873..81b54c36b 100644 --- a/README.md +++ b/README.md @@ -429,6 +429,8 @@ struct MyIterator { using reference = const char&; using iterator_category = std::input_iterator_tag; + explicit MyIterator(MyContainer* tgt = nullptr) : target(tgt) {} + MyIterator& operator++() { target->advance(); return *this; @@ -450,12 +452,12 @@ MyIterator begin(MyContainer& tgt) { } MyIterator end(const MyContainer&) { - return {}; + return MyIterator{}; } void foo() { MyContainer c; - json j = json::parse(c); + json j = json::parse(begin(c), end(c)); } ```