Generic Template implementation of merge sort in C++
Well, it's a bit curious to indent after template&lt;...&gt;, but at least you are consistent there.

In merge() I would mark the only variable const.

In mergesort() I would make both variables const auto. There's no reason to make them references.

And I would change the initialization of mid so mutable forward-iterators are good enough. In addition, you only really need to refer to size once, though I expect any half-way useable compiler to optimize it appropriately.

const auto mid = std::next(first, (size + 1) / 2);


Be aware that if you have random-access-iterators and first / mid are generally only moved a relatively small amount in merge each iteration, std::find_if (O(n)) would beat std::upper_boud (O(log(n))). Not that it matters, your in-place-merge will be quadratic in that case anyway.