mirror of
https://github.com/nlohmann/json.git
synced 2025-11-24 11:54:34 +08:00
Docs: Update skip_comments to ignore_comments (#3145)
In the docs, the `ignore_comments` parameter to `nlohmann::json::parse()` is described as `skip_comments`, which does not match the actual implementation. While the demo code compiles and works, the parameter name is wrong.
This commit is contained in:
@@ -25,7 +25,7 @@ However, you can pass set parameter `ignore_comments` to `#!c true` in the parse
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
When calling `parse` without additional argument, a parse error exception is thrown. If `skip_comments` is set to `#! true`, the comments are skipped during parsing:
|
When calling `parse` without additional argument, a parse error exception is thrown. If `ignore_comments` is set to `#! true`, the comments are ignored during parsing:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -55,7 +55,7 @@ However, you can pass set parameter `ignore_comments` to `#!c true` in the parse
|
|||||||
json j = json::parse(s,
|
json j = json::parse(s,
|
||||||
/* callback */ nullptr,
|
/* callback */ nullptr,
|
||||||
/* allow exceptions */ true,
|
/* allow exceptions */ true,
|
||||||
/* skip_comments */ true);
|
/* ignore_comments */ true);
|
||||||
std::cout << j.dump(2) << '\n';
|
std::cout << j.dump(2) << '\n';
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -80,4 +80,4 @@ However, you can pass set parameter `ignore_comments` to `#!c true` in the parse
|
|||||||
"Neptune"
|
"Neptune"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user