title: Difference between equivalent and equal for c++20 three way comparison operator?
body: <p>In c++20 the new three way comparison operator &lt;=&gt; (spaceship operator) is introduced and it can result into four values given below :</p>
  <ol>
  <li>std::strong_ordering::less</li>
  <li>std::strong_ordering::equivalent</li>
  <li>std::strong_ordering::equal</li>
  <li>std::strong_ordering::greater</li>
  </ol>
  <p>However when I run below code snippet it appears that both equal and equivalent are one and some thing, so I want to know what is the difference between them and in what scenario we should prefer one over another.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;compare&gt;
  int main()
  {
      std::strong_ordering res = (2&lt;=&gt;2);
      if(res == std::strong_ordering::equivalent)
      {
          std::cout&lt;&lt;&quot;Equivalent....&quot;&lt;&lt;std::endl;
      }
      if(res == std::strong_ordering::equal)
      {
          std::cout&lt;&lt;&quot;Equal&quot;&lt;&lt;std::endl;
      }
      return 0;
  }
  </code></pre>
  <p>O/P :</p>
  <p>Equivalent....</p>
  <p>Equal</p>