Elegant reference implementations of some common sorting algorithms in C++. By Morgan McGuire, December 2012.