Add comparison operator to objects.