C++ why bitvec[0].flip() works
<p>Based on C++ Primer 4th edition (i.e. pp 105),</p>

<pre><code>bitset&lt;32&gt; bitvec;

bitvec[0].flip(); // reverses the first bit.
</code></pre>

<p>My question is why the second line works? Based on </p>

<pre><code>http://www.cplusplus.com/reference/stl/bitset/operator[]/

     bool operator[] ( size_t pos ) const;
reference operator[] ( size_t pos );
</code></pre>

<p>How can bitset::flit can be used on bool or reference?</p>

<p>Thank you</p>
