I have found this question a few times, but none of them seem to offer a good answer (please mark as duplicate if I missed it).
I have a method that returns a std::vector<unsigned short>
, but I want to allow for more numbers than an unsigned short can hold, so I would like to convert it to a std::vector<int>
before I add my bigger numbers to it.
So I want to convert it while keeping the data & order intact. A std::vector<unsigned short>
that contains [1, 2, 3]
should contain [1, 2, 3]
after it has been converted to std::vector<int>
.