You can't implement merge sort "in place". If you swap or overwrite some of the elements, it isn't a merge sort anymore. In this case, moving an element from one sequence to other potentially breaks the other sequence (eg. it is no longer ordered).
static std::vector<int> merge(const std::vector<int>& one, const std::vector<int>& two)
{
std::vector<int>::const_iterator i = one.begin();
std::vector<int>::const_iterator j = two.begin();
std::vector<int> result;
while (i != one.end() && j != two.end())
{
if (*i < *j)
result.push_back(*i++);
else
result.push_back(*j++);
}
while (i != one.end())
result.push_back(*i++);
while (j != two.end())
result.push_back(*j++);
return result;
}
Please consider making the parameter to showvector a const reference.