title: Does Swift have a spaceship operator <=>, and if not how would a custom operator be created?
body: <p>From <a href="http://en.wikipedia.org/wiki/Spaceship_operator" rel="nofollow">Wikipedia</a>:</p>
  
  <blockquote>
    <p>Unlike traditional equality operators, which will return true or false
    depending on whether the arguments are equal or unequal, the spaceship
    operator will return 1, 0, or −1 depending on the value of the left
    argument relative to the right argument. If the left argument is
    greater than the right argument, the operator returns 1. If the left
    argument is less than the right argument, the operator returns −1. If
    the two arguments are equal, the operator returns 0.</p>
  </blockquote>
  
  <p><strong>The spaceship operator is primarily used for comparisons in sorting.</strong></p>