P2187 proposes a few mechanism to optimize conditional swap operations for standard library algorithms, using std::sort as a canonical example. There might be ideas worth reusing, so analyze the paper and related projects, benchmark, etc. and try to make the best of it.