Updated nlohmann::basicjson::is_string (markdown)

Niels committed 2015-04-11 18:46:26 +02:00
1 parent f66d7fa527
commit 43562943fb
1 file changed
+35
+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>