I can build an array and initialize it similar this:
int a[] = {10, 20, 30};
Whereby do I perform a
std::vector
and initialize it likewise elegant?
The most reliable approach I remember is:
std::vector<int> ints;
ints.push_back(10);
ints.push_back(20);
ints.push_back(30);
Is there a more reliable method?