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>
<divclass="memtemplate">
template<typename T , typename std::enable_if< not(std::is_same< T, int >::value) and std::is_same< T, number_integer_t >::value, int >::type = 0></div>
<dlclass="section note"><dt>Note</dt><dd>This constructor would have the same signature as <aclass="el"href="classnlohmann_1_1basic__json_acbf7f957ecb6ce19cdc5b40b5d6b6333.html#acbf7f957ecb6ce19cdc5b40b5d6b6333">basic_json(const int value)</a>, so we need to switch this one off in case number_integer_t is the same as int. This is done via the helper type <em>T</em>.</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_acbf7f957ecb6ce19cdc5b40b5d6b6333.html#acbf7f957ecb6ce19cdc5b40b5d6b6333"title="create an integer number from an enum type (explicit) ">basic_json(const int)</a></dd></dl>