c++ bitset 用法

std::bitset

 
C++
 
 
std::bitset
 
Defined in header  <bitset>
  
template< std::size_t N >
class bitset;
   
     

The class template bitset represents a fixed-size sequence of N bits. Bitsets can be manipulated by standard logic operators and converted to and from strings and integers.

bitset meets the requirements of CopyConstructible and CopyAssignable.

Template parameters

N-the number of bits to allocate storage for

Member types

proxy class representing a reference to a bit 
(class)

Member functions

constructs the bitset 
(public member function)
compares the contents 
(public member function)
Element access
accesses specific bit 
(public member function)
accesses specific bit 
(public member function)
(C++11)  
checks if all, any or none bits are set to true 
(public member function)
returns the number of bits set to true 
(public member function)
Capacity
returns the size number of bits that the bitset can hold 
(public member function)
Modifiers
performs binary AND, OR, XOR and NOT 
(public member function)
performs binary shift left and shift right 
(public member function)
set
sets bits to true or given value 
(public member function)
sets bits to false 
(public member function)
toggles the values of bits 
(public member function)
Conversions
returns a string representation of the data 
(public member function)
returns an unsigned long integer representation of the data 
(public member function)
(C++11)
returns an unsigned long long integer representation of the data 
(public member function)

Non-member functions

performs binary logic operations on bitsets 
(function template)
performs stream input and output of bitsets 
(function template)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值