Merge sort implementation efficiency
Not a merge sort

This step in the merge() function:

    for (size_t i = 0; i &lt; d1; ++i) {
        for (size_t j = 0; j &lt; d2; ++j) {
            if (*(f1 + i) &gt; *(f2 + j)) {
                std::iter_swap(f1 + i, f2 + j);
            }
        }
    }


is an \$O(N^2)\$ operation and works more like an insertion sort or bubble sort rather than a merge.  Also, you should only have to merge once instead of four times.  The pseudocode for the mergesort function should be:

mergesort(leftHalf);
mergesort(rightHalf);
merge(leftHalf, rightHalf);


I believe your merge function is not only slow but also doesn't merge properly in one pass, which is why your program seems to require calling it four times.