select_best: yet another partitioning algorithm
A couple of points on the style rather than the algorithm itself. 

First, I find the #ifdef for the typename peculiar, it detracts from clarity, and is a pointless use of macros, it may be fine for a small snippet but in a large project or a library header such a thing can wreak havoc. Consider simply,

template &lt;class BidirectionalIterator&gt;


That said, note that C++11 relaxes std::partition to a ForwardIterator, so I would simply say,

template &lt;class ForwardIterator&gt;
void select_best(ForwardIterator first, ForwardIterator mid, ForwardIterator last);


The type T is also a bad choice to denote a value_type, it has too much baggage as a template parameter. Simply say,

using value_type = typename I::value_type;


Then consider avoiding the inadvertent copy of the value by changing the code to take a const reference of the pivot,

const T&amp; pivot = *first;


The lambdas are arguably the preferred way to write the predicate (let's not venture into std::bind and std::min territory), but again I would capture the value by a reference to avoid a copy, and be less verbose, 

[&amp;](const T&amp; elt) { return elt &lt; pivot; }


Consider either using brackets with if-else clauses or at least put the conditional statement on a separate line.

if ( ... )
    statement;
else    


note that using std::distance implies that complexity of your function can blow up to O(n) for that use only (where n is the pp, somewhere around N/2), and if you want O(1) for the distance calculation you have to make sure your iterators are random access.

and last, please get rid of the ghastly space in else first = pp;.

For your question on the return value, would it be useful to return pp itself?