minor readme correction
This commit is contained in:
parent
b715a70673
commit
0da131d717
1 changed files with 2 additions and 3 deletions
|
@ -416,7 +416,7 @@ Please note that setting the exception bit for `failbit` is inappropriate for th
|
||||||
|
|
||||||
#### Read from iterator range
|
#### Read from iterator range
|
||||||
|
|
||||||
You can also parse JSON from an iterator range; that is, from any container accessible by iterators whose `value_type` is an integral type of 1, 2 or 4 bytes, for instance a `std::vector<std::uint8_t>`, or a `std::list<std::uint16_t>`:
|
You can also parse JSON from an iterator range; that is, from any container accessible by iterators whose `value_type` is an integral type of 1, 2 or 4 bytes, which will be interpreted as UTF-8, UTF-16 and UTF-32 respectively. For instance, a `std::vector<std::uint8_t>`, or a `std::list<std::uint16_t>`:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
std::vector<std::uint8_t> v = {'t', 'r', 'u', 'e'};
|
std::vector<std::uint8_t> v = {'t', 'r', 'u', 'e'};
|
||||||
|
@ -435,8 +435,6 @@ json j = json::parse(v);
|
||||||
Since the parse function accepts arbitrary iterator ranges, you can provide your own data sources by implementing the `LegacyInputIterator` concept.
|
Since the parse function accepts arbitrary iterator ranges, you can provide your own data sources by implementing the `LegacyInputIterator` concept.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
struct MyContainer;
|
|
||||||
|
|
||||||
struct MyContainer {
|
struct MyContainer {
|
||||||
void advance();
|
void advance();
|
||||||
const char& get_current();
|
const char& get_current();
|
||||||
|
@ -451,6 +449,7 @@ struct MyIterator {
|
||||||
|
|
||||||
MyIterator& operator++() {
|
MyIterator& operator++() {
|
||||||
MyContainer.advance();
|
MyContainer.advance();
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const MyIterator& rhs) const {
|
bool operator!=(const MyIterator& rhs) const {
|
||||||
|
|
Loading…
Reference in a new issue