\hypertarget{containers_8h}{}\doxysection{kblib/containers.h File Reference} \label{containers_8h}\index{kblib/containers.h@{kblib/containers.h}} Provides generic operations for containers, as well as \mbox{\hyperlink{classkblib_1_1stack}{kblib\+::stack}}. {\ttfamily \#include \char`\"{}fakestd.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}iterators.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}tdecl.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}traits.\+h\char`\"{}}\newline {\ttfamily \#include $<$cstddef$>$}\newline {\ttfamily \#include $<$deque$>$}\newline {\ttfamily \#include $<$iterator$>$}\newline {\ttfamily \#include $<$memory$>$}\newline {\ttfamily \#include $<$stack$>$}\newline {\ttfamily \#include $<$type\+\_\+traits$>$}\newline {\ttfamily \#include $<$vector$>$}\newline Include dependency graph for containers.\+h\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{containers_8h__incl} \end{center} \end{figure} This graph shows which files directly or indirectly include this file\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{containers_8h__dep__incl} \end{center} \end{figure} \doxysubsection*{Classes} \begin{DoxyCompactItemize} \item struct \mbox{\hyperlink{structkblib_1_1exists__t}{kblib\+::exists\+\_\+t$<$ iterator $>$}} \item struct \mbox{\hyperlink{structkblib_1_1construct__with__size}{kblib\+::construct\+\_\+with\+\_\+size$<$ C, size $>$}} \item struct \mbox{\hyperlink{structkblib_1_1construct__with__capacity}{kblib\+::construct\+\_\+with\+\_\+capacity$<$ C, size $>$}} \item class \mbox{\hyperlink{classkblib_1_1build__iterator}{kblib\+::build\+\_\+iterator$<$ Container, Array\+Like $>$}} \item struct \mbox{\hyperlink{structkblib_1_1build__end__t}{kblib\+::build\+\_\+end\+\_\+t}} \item class \mbox{\hyperlink{classkblib_1_1build__iterator_3_01_container_00_01true_01_4}{kblib\+::build\+\_\+iterator$<$ Container, true $>$}} \item struct \mbox{\hyperlink{structstd_1_1tuple__size_3_1_1kblib_1_1construct__with__size_3_01_c_00_01_size_01_4_01_4}{std\+::tuple\+\_\+size$<$\+::kblib\+::construct\+\_\+with\+\_\+size$<$ C, Size $>$ $>$}} \item struct \mbox{\hyperlink{structkblib_1_1detail_1_1buildiota__impl_3_01construct__with__size_3_01_container_00_01_n_01_4_00_01false_01_4}{kblib\+::detail\+::buildiota\+\_\+impl$<$ construct\+\_\+with\+\_\+size$<$ Container, N $>$, false $>$}} \item class \mbox{\hyperlink{classkblib_1_1stack}{kblib\+::stack$<$ T, Container $>$}} \end{DoxyCompactItemize} \doxysubsection*{Namespaces} \begin{DoxyCompactItemize} \item namespace \mbox{\hyperlink{namespacekblib}{kblib}} \begin{DoxyCompactList}\small\item\em The main namespace in which all entities from kblib are defined. \end{DoxyCompactList}\item namespace \mbox{\hyperlink{namespacestd}{std}} \item namespace \mbox{\hyperlink{namespacekblib_1_1detail}{kblib\+::detail}} \begin{DoxyCompactList}\small\item\em The namespace used for implementation details within kblib. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Functions} \begin{DoxyCompactItemize} \item {\footnotesize template$<$typename C $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_ad505bc6a8318d39ac08f85bf9a8cddbb}{kblib\+::pop}} (C \&s) -\/$>$ typename C\+::value\+\_\+type \item {\footnotesize template$<$class C , typename K , typename V $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a255d018d13394a47c014b2929a35a3b5}{kblib\+::get\+\_\+or}} (const C \&m, const K \&key, const V \&defval) -\/$>$ typename C\+::mapped\+\_\+type \item {\footnotesize template$<$typename Map , typename Key $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_ac2b7bd4d50cea42484b9824a8140602f}{kblib\+::try\+\_\+get}} (Map \&map, Key \&\&key) -\/$>$ copy\+\_\+const\+\_\+t$<$ Map, typename Map\+::mapped\+\_\+type $>$ $\ast$ \item {\footnotesize template$<$typename M , typename K $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_ae0ceac8ca285d73c019ff7822c3a89d3}{kblib\+::get\+\_\+check}} (M \&\&m, const K \&key) noexcept(noexcept(m.\+find(key) !=m.\+end())) -\/$>$ exists\+\_\+t$<$ decltype(m.\+find(key))$>$ \item {\footnotesize template$<$typename V $>$ }\\auto \mbox{\hyperlink{namespacekblib_a0796644f9c5f55c99e916160cc085319}{kblib\+::force\+\_\+shrink\+\_\+to\+\_\+fit}} (V \&vec) -\/$>$ void \begin{DoxyCompactList}\small\item\em std\+::vector\+::shrink\+\_\+to\+\_\+fit is non-\/binding, which means that there is no guaranteed way to shrink a vector via its API. This function is a roundabout way of doing that without relying on the sanity of the implementation (except that it assumes that a vector won\textquotesingle{}t significantly over-\/allocate on sized construction). \end{DoxyCompactList}\item {\footnotesize template$<$typename Container , typename Range $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a639f719064a3ea44cd586faac94ac012}{kblib\+::construct\+\_\+from\+\_\+range}} (Range \&\&r) -\/$>$ Container \begin{DoxyCompactList}\small\item\em Allows for constructing a container of a specified type from a range object. Copy elision means that this does not result in any extra copies. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Variables} \begin{DoxyCompactItemize} \item constexpr struct \mbox{\hyperlink{structkblib_1_1build__end__t}{kblib\+::build\+\_\+end\+\_\+t}} \mbox{\hyperlink{namespacekblib_aad99c3a2af651595f17e2c95c2c521d4}{kblib\+::build\+\_\+end}} \end{DoxyCompactItemize} \doxysubsection{Detailed Description} Provides generic operations for containers, as well as \mbox{\hyperlink{classkblib_1_1stack}{kblib\+::stack}}. \begin{DoxyAuthor}{Author} killerbee \end{DoxyAuthor} \begin{DoxyDate}{Date} 2019-\/2021 \end{DoxyDate} \begin{DoxyCopyright}{Copyright} GNU General Public Licence v3.\+0 \end{DoxyCopyright} Definition in file \mbox{\hyperlink{containers_8h_source}{containers.\+h}}.