Operator
语法:
1 |
!=, ==, &=, ^=, |=, ~, <<=, >>=, [] |
这些操作符都可以和bitsets一起工作。它们被这样定义:
- != 返回真如果两个bitset不相等。
- == 返回真如果两个bitset相等。
- &= 完成两个bitset间的与运算。
- ^= 完成两个bitset间的异或运算。
- |= 完成两个
- ~ 反置bitset (和调用 flip()类似)
- <<= 把bitset向左移动
- >>= 把bitset向右移动
- [x] 返回第x个位的引用
以下是操作符重载测试例:
当上述代码运行时,显示:
初始值:10010111
左移5位:11100000
右移5位:00000111
第 0位:1
第 1位:1
第 2位:1
第 3位:0
第 4位:0
第 5位:0
第 6位:0
第 7位:0
反置:11111000
bs3不等于bs4
bs3&=bs4过算:00000000
bs3^=bs4过算:01111000
bs3|=bs4过算:01111000
请按任意键继续. . .
Great material. Appreciate it. metformin nebenwirkungen
Amazing many of terrific facts! charlotte’s web cbd oil
You actually stated this adequately! canadian pharmacies-24h
You said it nicely.. https://viagrapython.com/
You stated this fantastically. finasteride tablets
Cheers, A lot of knowledge.
metronidazole
Wonderful postings. Thank you. buy viagra online
With thanks, I appreciate it! Provigil Generic Competition
You actually revealed this superbly. cialis vs viagra