C++ keyword: compl
From cppreference.com
[edit] Usage
- alternative operators: as an alternative for
~
[edit] Example
Run this code
#include <bitset> #include <iostream> using bin = std::bitset<8>; void show(bin z, const char* s, int n) { if (n == 0) std::cout << "βββββββββββ¬βββββββββββ\n"; if (n <= 2) std::cout << "β "<<s<<" β " <<z<<" β\n"; if (n == 2) std::cout << "βββββββββββ΄βββββββββββ\n"; } struct A { compl A() { std::cout << "A dtor\n"; } }; int main() { bin x{"01011010"}; show(x, "x ", 0); bin z = compl x; show(z, "compl x", 2); A a; }
Output:
βββββββββββ¬βββββββββββ β x β 01011010 β β compl x β 10100101 β βββββββββββ΄βββββββββββ A dtor