title: Assign a value to Bitset
body: <p>I'm curious to know why the following code is working!
  According to bitset template class, you can assign a value to bitset (int or binary representation as string) by constructor but not after that.
  But here you can see that explicit assign of a integer works fine.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;bitset&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main()
  {
      bitset&lt;8&gt; b(string("101"));
      cout &lt;&lt; b.to_ullong()&lt;&lt;"\n";
      b= 145;
      cout &lt;&lt; b&lt;&lt;"\n";
      return 0;
  }
  </code></pre>
  
  <p>this question also might be relevant.
  <a href="https://stackoverflow.com/questions/17360953/how-to-assign-bitset-value-from-a-string-after-initializaion">How to assign bitset value from a string after initializaion</a>   </p>