Document SIMDJSON_EXCEPTIONS (#1443)
* Document SIMDJSON_EXCEPTIONS * Add an example * Enchance clarity
This commit is contained in:
parent
610b3ad302
commit
c5def8f706
|
@ -555,6 +555,12 @@ bool parse_string(const char *j, std::string &s) {
|
|||
}
|
||||
```
|
||||
|
||||
To ensure you don't write any code that uses exceptions, compile with `SIMDJSON_EXCEPTIONS=OFF`. For example, if including the project via cmake:
|
||||
|
||||
```cmake
|
||||
target_compile_definitions(simdjson PUBLIC SIMDJSON_EXCEPTIONS=OFF)
|
||||
```
|
||||
|
||||
### Exceptions
|
||||
|
||||
Users more comfortable with an exception flow may choose to directly cast the `simdjson_result<T>` to the desired type:
|
||||
|
|
Loading…
Reference in New Issue