mirror of
https://github.com/nlohmann/json.git
synced 2026-09-02 22:47:14 +00:00
📝 fix documentation
Closes #4354: fix "Custom data source" example Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user