<h1id="Standard-C++-Library-(STL)"><ahref="https://cppreference.com/"><center>Standard C++ Library (STL)</center></a><aclass="anchor-link"href="#Standard-C++-Library-(STL)">¶</a></h1>
<h2id="std::cout-and-std::cerr"><ahref="https://en.cppreference.com/w/cpp/io/cout">std::cout</a> and <ahref="https://en.cppreference.com/w/cpp/io/cerr">std::cerr</a><aclass="anchor-link"href="#std::cout-and-std::cerr">¶</a></h2><ul>
<li>To use the <strong>std::cout</strong>, <strong>std::cerr</strong>, <strong>std::endl</strong>, <strong>std::flush</strong> features of the STL you have to include <strong>iostream</strong></li>
<li>The object <ahref="https://en.cppreference.com/w/cpp/io/cout">std::cout</a> can be used to output things to screen via the so-called standard output channel</li>
<h2id="std::scientific-and-std::setprecision"><ahref="https://en.cppreference.com/w/cpp/io/manip/fixed">std::scientific</a> and <ahref="https://en.cppreference.com/w/cpp/io/manip/setprecision">std::setprecision</a><aclass="anchor-link"href="#std::scientific-and-std::setprecision">¶</a></h2><ul>
<li>include <strong>iomanip</strong></li>
<li>Scientific representation of numbers: 6.5e23: <ahref="https://en.cppreference.com/w/cpp/io/manip/fixed">std::scientific</a></li>
<h2id="std::algorithms">std::algorithms<aclass="anchor-link"href="#std::algorithms">¶</a></h2><p>There are many <ahref="https://en.cppreference.com/w/cpp/algorithm">STL algorithms</a> available.</p>
<p>For instance three of them are presented below:</p>
<ul>
<li><ahref="https://en.cppreference.com/w/cpp/algorithm/find">std::find</a> searches for a match in a container in $O(N)$ advances</li>
<li><p><ahref="https://en.cppreference.com/w/cpp/algorithm/sort">std::sort</a> sorts a container
in $N*log2(N)$ swaps (which then is not the same for list, vectors)</p>
</li>
<li><p><ahref="https://en.cppreference.com/w/cpp/algorithm/binary_search">std::binary_search</a> searches into a sorted container in $O(log2(N))$ advances
(which is then long for non random access iterators like lists)</p>
</li>
<li><ahref="https://en.cppreference.com/w/cpp/algorithm/set_intersection">std::set_intersection</a> returns the intersection between sets</li>
<divclass="highlight"><pre><span></span><spanclass="k">auto</span><spanclass="n">foo2</span><spanclass="o">=</span><spanclass="p">[]()</span><spanclass="p">{</span><spanclass="n">std</span><spanclass="o">::</span><spanclass="n">cout</span><spanclass="o"><<</span><spanclass="s">"Hey again !"</span><spanclass="o"><<</span><spanclass="n">std</span><spanclass="o">::</span><spanclass="n">endl</span><spanclass="p">;</span><spanclass="p">};</span>