📝 fix documentation

Closes #4354: fix "Custom data source" example

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-06-30 09:10:19 +02:00
parent aade7e209b
commit 17238aac61
+4 -2
View File
@@ -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));
}
```