bitand宏
概要:
#define bitand &
描述:
该宏是位运算符&(按位与)的替代拼写方案。
按位与运算符的运算规则:
1 & 1 = 1
1 & 0 = 0
0 & 1 = 0
0 & 0 = 0
范例:
 | 
                        
                         | 
                    
输出:
5
5的二进制形式为:0101
7的二进制形式为:0111
| 0 | 1 | 0 | 1 | |
| & | 0 | 1 | 1 | 1 | 
| 0 | 1 | 0 | 1 | 
所以(5 bitand 7)的结果为5。
相关内容:
| and | 表示&&的宏。 | 
| and_eq | 表示&=的宏。 |