Should have included <algorithm>, not <xutility>