title: std::vector<bool> with only one true element
body: <p>I need an <code>std::vector&lt;bool&gt;</code>, in which only one element may be true later in the program.
  My attempt was ( in a for-loop)</p>
  
  <pre><code>BOOST_FOREACH( bool b, boolvector)
  {
      b = false;
  }
  boolvector[j] = true;
  </code></pre>
  
  <p>But when this executes the elements don't get reset to false when doing the BOOST_FOREACH (function of the boost library to iterate more conveniently through containers ( see <a href="http://www.boost.org/doc/libs/1_54_0/doc/html/foreach.html" rel="nofollow">boost documentation</a>).</p>
  
  <p>P.S.: I know that std::vector is a broken thing, but it should suffice.</p>