title: Why doesn't std::swap work on vector<bool> elements under Clang/Win?
body: <p>I have code like this:</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;utility&gt;
  
  int main()
  {
     std::vector&lt;bool&gt; vb{true, false};
     std::swap(vb[0], vb[1]);
  }
  </code></pre>
  
  <p>Arguments about the sanity of <code>vector&lt;bool&gt;</code> aside, this was working just fine on:</p>
  
  <ul>
  <li>Clang for Mac</li>
  <li>Visual Studio for Windows</li>
  <li>GCC for Linux</li>
  </ul>
  
  <p>Then I tried building it with Clang on Windows and received the following error (abridged):</p>
  
  <pre><code>error: no matching function for call to 'swap'
                                  std::swap(vb[0], vb[1]);
                                  ^~~~~~~~~
  
  note: candidate function [with _Ty = std::_Vb_reference&lt;std::_Wrap_alloc&lt;std::allocator&lt;unsigned int&gt; &gt; &gt;, $1 = void] not viable: expects an l-value for 1st argument
  inline void swap(_Ty&amp; _Left, _Ty&amp; _Right) _NOEXCEPT_COND(is_nothrow_move_constructible_v&lt;_Ty&gt;&amp;&amp;
  </code></pre>
  
  <p>I'm surprised that the results differ across implementations.</p>
  
  <p>Why does it not work with Clang on Windows?</p>