Why does the compiler complain about a missing constructor when I'm just resizing my std::vector to a smaller size?
https://devblogs.microsoft.com/oldnewthing/20230711-00/?p=108408Open linkView original on programming.devSyndicated from the fediverse. Read and engage on the original instance.
View original on programming.dev
https://devblogs.microsoft.com/oldnewthing/20230711-00/?p=108408Open linkView original on programming.dev
3 replies
Thank you. But why not just init the vector std::vector vect(56) And then resize 🧐
That vector constructor still requires a default constructor for the class of the object contained by the vector, so it's the same issue but different context.
I saw the article on my mastodon feed. When it's interesting I usually post it here