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 user"><dt>Requirements</dt><dd>This function satisfies the Container requirements:<ul>
<li>The complexity is constant.</li>
</ul>
</dd></dl>
<dlclass="section user"><dt>Example</dt><dd>The following code shows an example for <aclass="el"href="classnlohmann_1_1basic__json_af4261341695729a8e657b94772f95516.html#af4261341695729a8e657b94772f95516">begin</a>. <divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="preprocessor">#include <json.hpp></span></div>
<divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">// get am iterator to the first element</span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <aclass="code"href="classnlohmann_1_1basic__json_1_1iterator.html">json::iterator</a> it = array.<aclass="code"href="classnlohmann_1_1basic__json_af4261341695729a8e657b94772f95516.html#af4261341695729a8e657b94772f95516">begin</a>();</div>
<divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment">// serialize the element that the iterator points to</span></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="classnlohmann_1_1basic__json_1_1iterator_html"><divclass="ttname"><ahref="classnlohmann_1_1basic__json_1_1iterator.html">nlohmann::basic_json::iterator</a></div><divclass="ttdoc">a random access iterator for the basic_json class </div><divclass="ttdef"><b>Definition:</b> json.hpp:3139</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>
<divclass="ttc"id="classnlohmann_1_1basic__json_af4261341695729a8e657b94772f95516_html_af4261341695729a8e657b94772f95516"><divclass="ttname"><ahref="classnlohmann_1_1basic__json_af4261341695729a8e657b94772f95516.html#af4261341695729a8e657b94772f95516">nlohmann::basic_json::begin</a></div><divclass="ttdeci">iterator begin() noexcept</div><divclass="ttdoc">returns an iterator to the first element </div><divclass="ttdef"><b>Definition:</b> json.hpp:2015</div></div>
<divclass="ttc"id="classnlohmann_1_1basic__json_a53590b99e380c464a83a0a5edf6da9ab_html_a53590b99e380c464a83a0a5edf6da9ab"><divclass="ttname"><ahref="classnlohmann_1_1basic__json_a53590b99e380c464a83a0a5edf6da9ab.html#a53590b99e380c464a83a0a5edf6da9ab">nlohmann::basic_json::array</a></div><divclass="ttdeci">static basic_json array(list_init_t init=list_init_t())</div><divclass="ttdoc">explicitly create an array from an initializer list </div><divclass="ttdef"><b>Definition:</b> json.hpp:815</div></div>
</div><!-- fragment --> Output: <preclass="fragment">1
</pre> The example code above can be translated with<preclass="fragment">g++ -std=c++11 -Isrc doc/examples/begin.cpp -o begin </pre>. </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->