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>
Create a null
JSON value. This is the explicitly version of the null
value constructor as it takes a null pointer as parameter. It allows to create null
values by explicitly assigning a nullptr
to a JSON value. The passed null pointer itself is not read – it is only used to choose the right constructor.
- Complexity
- Constant.
- Example
- The following code shows the constructor with null pointer parameter.
11 std::cout << j <<
'\n';
a class to store JSON values
namespace for Niels Lohmann
Output (play with this example online): null
The example code above can be translated withg++ -std=c++11 -Isrc doc/examples/basic_json__nullptr_t.cpp -o basic_json__nullptr_t
- See also
- basic_json() – default constructor (implicitly creating a
null
value)
- Since
- version 1.0.0
Definition at line 920 of file json.hpp.