Generic protocol for totally-ordered objects