So I have a question that involves returning 2 values as a vector on leetcode. What I want to do is after finding these two values, create a new vector with these values and return the vector at the same time. Essentially, turn the lines
vector<int> temp;
temp.push_back(a);
temp.push_back(b);
return temp;
into one line, hopefully something like
return new vector<int>{a,b};
Is it possible to do something like this in C++?