Say I want all numbers from 23 to 57 be in a vector
. I can do this:
vector<int> result;
for (int i = 23; i <= 57; ++i)
{
result.push_back(i);
}
But this is a 5 line solution for a simple job. Can't I do that more elegantly? The best syntax would be vector<int> result{23 .. 57};
for example or such a trivial one line code. Any options with C++17?