title: How to prevent specialization of std::vector<bool>
body: <p>I have a templated class that has a data member of type <code>std::vector&lt;T&gt;</code>, where T is also a parameter of my templated class.</p>
  
  <p>In my template class I have quite some logic that does this:</p>
  
  <pre><code>T &amp;value = m_vector[index];
  </code></pre>
  
  <p>This doesn't seem to compile when T is a boolean, because the [] operator of std::vector does not return a bool-reference, but a different type.</p>
  
  <p>Some alternatives (although I don't like any of them):</p>
  
  <ul>
  <li>tell my users that they must not use bool as template parameter</li>
  <li>have a specialization of my class for bool (but this requires some code duplication)</li>
  </ul>
  
  <p>Isn't there a way to tell std::vector not to specialize for bool?</p>