📝 add more examples
This commit is contained in:
parent
02ff16f645
commit
875e9a3768
13
docs/examples/~basic_json.cpp
Normal file
13
docs/examples/~basic_json.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
json* j = new json("Hello, world!");
|
||||
std::cout << *j << std::endl;
|
||||
|
||||
// explicitly call destructor
|
||||
delete j;
|
||||
}
|
||||
1
docs/examples/~basic_json.output
Normal file
1
docs/examples/~basic_json.output
Normal file
@ -0,0 +1 @@
|
||||
"Hello, world!"
|
||||
@ -14,6 +14,22 @@ No-throw guarantee: this member function never throws exceptions.
|
||||
|
||||
Linear.
|
||||
|
||||
## Examples
|
||||
|
||||
??? example
|
||||
|
||||
The following code shows an example for the destructor.
|
||||
|
||||
```cpp
|
||||
--8<-- "examples/~basic_json.cpp"
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
--8<-- "examples/~basic_json.output"
|
||||
```
|
||||
|
||||
## Version history
|
||||
|
||||
- Added in version 1.0.0.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user