title: Is it possible to create a vector of bitsets?
body: <p>I am trying to create a vector of bitsets in C++. For this, I have tried the attempt as shown in  the code snippet below:</p>
  
  <pre><code>vector&lt;bitset&lt;8&gt;&gt; bvc;
      while (true) {
          bitset&lt;8&gt; bstemp( (long) xtemp );
          if (bstemp.count == y1) {
              bvc.push_back(bstemp);
          }
          if ( xtemp == 0) {
              break;
          }
          xtemp = (xtemp-1) &amp; ntemp;
      }
  </code></pre>
  
  <p>When I try to compile the program, I get the error that reads that <code>bvc</code> was not declared in the scope. It further tells that the template argument 1 and 2 are invalid. (the 1st line). Also, in the line containing <code>bvc.push_back(bstemp)</code>, I am getting an error that reads invalid use of member function.</p>