Skip to content

Commit

Permalink
Clarify that value-init is used when STL enlarges containers.
Browse files Browse the repository at this point in the history
  • Loading branch information
hageboeck committed Oct 2, 2024
1 parent 48a8bce commit 0d6647b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion talk/morelanguage/initialization.tex
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
\item Unless \cppinline{T} has a \cppinline{std::initializer_list} constructor that you do not want to call!
\item Be wary of \cppinline{std::vector}!
\end{itemize}
\item The STL value initializes when creating new user objects
\item The STL uses value inititalisation when resizing containers
\begin{itemize}
\item E.g. \cppinline{vec.resize(vec.size() + 10);}
\end{itemize}
Expand Down

0 comments on commit 0d6647b

Please sign in to comment.