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></div>
<dlclass="section note"><dt>Note</dt><dd>This constructor allows to pass enums directly to a constructor. As C++ has no way of specifying the type of an anonymous enum explicitly, we can only rely on the fact that such values implicitly convert to int. As int may already be the same type of number_integer_t, we may need to switch off the constructor <aclass="el"href="classnlohmann_1_1basic__json_a190d719446e7016879c4b961c9cf9072.html#a190d719446e7016879c4b961c9cf9072">basic_json(const number_integer_t)</a>.</dd></dl>
<dlclass="section user"><dt>Example</dt><dd>The example below shows the construction of a JSON integer number value. <divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="preprocessor">#include <json.hpp></span></div>
<divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment">// create a JSON number from number_integer_t</span></div>
<divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <aclass="code"href="classnlohmann_1_1basic__json_a6944904b3b59769b1cf62ac2532cbe33.html#a6944904b3b59769b1cf62ac2532cbe33">json::number_integer_t</a> value = 42;</div>
<divclass="ttc"id="classnlohmann_1_1basic__json_html"><divclass="ttname"><ahref="classnlohmann_1_1basic__json.html">nlohmann::basic_json</a></div><divclass="ttdoc">a class to store JSON values </div><divclass="ttdef"><b>Definition:</b> json.hpp:121</div></div>
<divclass="ttc"id="namespacenlohmann_html"><divclass="ttname"><ahref="namespacenlohmann.html">nlohmann</a></div><divclass="ttdoc">namespace for Niels Lohmann </div><divclass="ttdef"><b>Definition:</b> json.hpp:56</div></div>
<divclass="ttc"id="classnlohmann_1_1basic__json_a6944904b3b59769b1cf62ac2532cbe33_html_a6944904b3b59769b1cf62ac2532cbe33"><divclass="ttname"><ahref="classnlohmann_1_1basic__json_a6944904b3b59769b1cf62ac2532cbe33.html#a6944904b3b59769b1cf62ac2532cbe33">nlohmann::basic_json::number_integer_t</a></div><divclass="ttdeci">NumberIntegerType number_integer_t</div><divclass="ttdoc">a type for a number (integer) </div><divclass="ttdef"><b>Definition:</b> json.hpp:195</div></div>
</div><!-- fragment --> Output: <preclass="fragment">42
</pre> The example code above can be translated with<preclass="fragment">g++ -std=c++11 -Isrc doc/examples/basic_json__number_integer_t.cpp -o basic_json__number_integer_t </pre>.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classnlohmann_1_1basic__json_a190d719446e7016879c4b961c9cf9072.html#a190d719446e7016879c4b961c9cf9072"title="create an integer number (explicit) ">basic_json(const number_integer_t)</a></dd></dl>