JSON for Modern C++  3.0
template<template< typename U, typename V, typename...Args > class ObjectType = std::map, template< typename U, typename...Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = int64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator>
nlohmann::basic_json::basic_json ( )
defaultnoexcept

Create a null JSON value. This is the implicit version of the null value constructor as it takes no parameters.

Complexity
Constant.
Requirements
This function satisfies the Container requirements:
Example
The following code shows the constructor for a null JSON value.
1 #include <json.hpp>
2 
3 using namespace nlohmann;
4 
5 int main()
6 {
7  // create a JSON value with default null value
8  json j;
9 
10  // serialize the JSON null value
11  std::cout << j << '\n';
12 }
a class to store JSON values
Definition: json.hpp:130
namespace for Niels Lohmann
Definition: json.hpp:55
Output (play with this example online):
null
The example code above can be translated with
g++ -std=c++11 -Isrc doc/examples/basic_json.cpp -o basic_json 
See also
basic_json(std::nullptr_t)