this post was submitted on 11 Jul 2023
8 points (100.0% liked)

C++

1730 readers
1 users here now

The center for all discussion and news regarding C++.

Rules

founded 1 year ago
MODERATORS
all 4 comments
sorted by: hot top controversial new old
[โ€“] Arkaniol@programming.dev 1 points 1 year ago (1 children)

Thank you. But why not just init the vector std::vector vect(56) And then resize ๐Ÿง

[โ€“] KRAW@linux.community 1 points 1 year ago

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.