Add non-const overload to partition() function.

Authored by stikonas on Mar 3 2018, 4:31 PM.