Bitset类flip函数运用

flip

语法:

  bitset &flip();
  bitset &flip( size_t pos );
 /**源代码       
*  @brief Toggles every bit to its opposite value.      
*/      
bitset<_Nb>&      
flip()      
{        
this->_M_do_flip();        
this->_M_do_sanitize();        
return *this;
}     
/**       
*  @brief Toggles a given bit to its opposite value.       
*  @param  position  The index of the bit.       
*  @throw  std::out_of_range  If @a pos is bigger the size of the %set.      */      
bitset<_Nb>&      
flip(size_t __position)      
{
if (__position >= _Nb)      
__throw_out_of_range(__N("bitset::flip"));        
return _Unchecked_flip(__position);      
}

继续阅读Bitset类flip函数运用