##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# C++ keywords: and_eq

From cppreference.com
< cpp‎ | keyword

### [edit] Usage

- alternative operators: as an alternative for `&=`

### [edit] Example

Run this code

    #include <iostream>
    #include <bitset>
    int main()
    {
        std::bitset<4> mask("1100");
        std::bitset<4> val("0111");
        val and_eq mask;
        std::cout << val << '\n';
    }

Output:

    0100

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/keyword/and_eq&oldid=44542"