From 0d6647b2a8bfbbd42754e3f3623533755d1f4a1e Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Wed, 2 Oct 2024 11:36:28 +0200 Subject: [PATCH] Clarify that value-init is used when STL enlarges containers. --- talk/morelanguage/initialization.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talk/morelanguage/initialization.tex b/talk/morelanguage/initialization.tex index aa683f0a..ceeca545 100644 --- a/talk/morelanguage/initialization.tex +++ b/talk/morelanguage/initialization.tex @@ -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}