Check out example codes for "if vector is empty c++". It will help you in understanding the concepts better.

Code Example 1

v.empty() // returns true if vector v is empty

Code Example 2

return vector<int>();
//or
return{};

Learn ReactJs, React Native from akashmittal.com