Never sort a render queue with std::sort(). It is neither stable (most important factor) nor fast enough thanks to pointer function calls on each compare. Create a templated base class that uses < and == operators within its code and add these as inlined overridden operators to the render-queue item class/structure.
std::sort (and presumably std::stable_sort, but I've not tried it) can and does inline the comparison. That will happen both when using the default < operator, and when specifying a functor to compare with like std::greater<T>(). Other cases do not inline so well in my experience.
Of course in general no inlining is guaranteed by the compiler, so if you care about such things double check the disassembly in an optimized build.