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>
<p>Constructs a JSON array value by creating <em>count</em> copies of a passed value. In case <em>count</em> is <code>0</code>, an empty array is created. As postcondition, <code>std::distance(<aclass="el"href="classnlohmann_1_1basic__json_af4261341695729a8e657b94772f95516.html#af4261341695729a8e657b94772f95516"title="returns an iterator to the first element ">begin()</a>,<aclass="el"href="classnlohmann_1_1basic__json_ad8f84e6fb9bbf9a7bc767962ad0fe3a1.html#ad8f84e6fb9bbf9a7bc767962ad0fe3a1"title="returns an iterator to one past the last element ">end()</a>) == count</code> holds.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">count</td><td>the number of JSON copies of <em>value</em> to create </td></tr>
<tr><tdclass="paramname">value</td><td>the JSON value to copy</td></tr>
</table>
</dd>
</dl>
<dlclass="section user"><dt>Complexity</dt><dd>Linear in <em>count</em>.</dd></dl>
<dlclass="section user"><dt>Example</dt><dd>The following code shows examples for the <aclass="el"href="classnlohmann_1_1basic__json_add77b50f69debb20e98d5a8c6c11c90c.html#add77b50f69debb20e98d5a8c6c11c90c">basic_json(size_type, const basic_json&)</a> constructor. <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 an array by creating copies of a JSON value</span></div>
<divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <aclass="code"href="classnlohmann_1_1basic__json.html">json</a> value = <spanclass="stringliteral">"Hello"</span>;</div>
<divclass="ttc"id="namespacenlohmann_a2bfd99e845a2e5cd90aeaf1b1431f474_html_a2bfd99e845a2e5cd90aeaf1b1431f474"><divclass="ttname"><ahref="namespacenlohmann_a2bfd99e845a2e5cd90aeaf1b1431f474.html#a2bfd99e845a2e5cd90aeaf1b1431f474">nlohmann::json</a></div><divclass="ttdeci">basic_json<> json</div><divclass="ttdoc">default JSON class </div><divclass="ttdef"><b>Definition:</b> json.hpp:5634</div></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:113</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:49</div></div>
</div><!-- fragment --> Output: <preclass="fragment">[]
["Hello"]
["Hello","Hello","Hello","Hello","Hello"]
</pre> The example code above can be translated with<preclass="fragment">g++ -std=c++11 -Isrc doc/examples/basic_json__size_type_basic_json.cpp -o basic_json__size_type_basic_json </pre>. </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->