I came across this code recently but don't quite understand what's going on.
auto c = vector<int> {};
What is the vector constructor returning?
Then this code:
c = vector<int> {1,2,3,4,5 };
Is the second c
at a different memory location to the initial c
?
Is the destructor called when c
is reinitialised?
I searched the internet but could not find any examples of the above code.
How is the above different to
vector<int> c {};
Thanks in advance for any help.