Updated nlohmann::basicjson::is_object (markdown)
1 parent
8e220a8190
commit
542834590a
1 file changed
+35
@@ -22,6 +22,41 @@ Constant.
|
||||
|
||||
None. The function's noexcept-specification is `noexcept`.
|
||||
|
||||
## Example
|
||||
|
||||
```cpp
|
||||
#include <iostream>
|
||||
#include <json.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
nlohmann::json j_null;
|
||||
nlohmann::json j_boolean = true;
|
||||
nlohmann::json j_number = 17;
|
||||
nlohmann::json j_object = {{"one", 1}, {"two", 2}};
|
||||
nlohmann::json j_array = {1, 2, 4, 8, 16};
|
||||
nlohmann::json j_string = "Hello, world";
|
||||
|
||||
std::cout << std::boolalpha << j_null.is_null() << '\n';
|
||||
std::cout << std::boolalpha << j_boolean.is_boolean() << '\n';
|
||||
std::cout << std::boolalpha << j_number.is_number() << '\n';
|
||||
std::cout << std::boolalpha << j_object.is_object() << '\n';
|
||||
std::cout << std::boolalpha << j_array.is_array() << '\n';
|
||||
std::cout << std::boolalpha << j_string.is_string() << '\n';
|
||||
}
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
```
|
||||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
true
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [**is_null**](https://github.com/nlohmann/json/wiki/nlohmann::basicjson::is_null)<br>
|
||||
|
||||
Reference in new issue
Block a user