Hacker News new | ask | show | jobs
by mehrdadn 2209 days ago
> Once the vector is constructed, we can only add elements one by one by using the push_back member function.

Nope... std::vector::insert() takes an std::initializer_list [1].

[1] https://en.cppreference.com/w/cpp/container/vector/insert