Use iterator_traits to obtain iterator properties.
Use std::inplace_merge in merge_sort algorithm