Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions docs/standard-library/bit.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "<bit>"
description: "Functions to access, manipulate, and process individual bits and sequences of bits."
ms.date: "08/28/2020"
ms.date: 08/28/2020
f1_keywords: ["<bit>"]
helpviewer_keywords: ["bit header"]
---
Expand All @@ -13,9 +13,9 @@ For example, there are functions to rotate bits, find the number of consecutive

## Requirements

**Header:** \<bit>
**Header:** `<bit>`

**Namespace:** std
**Namespace:** `std`

[`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later is required.

Expand All @@ -25,24 +25,24 @@ For example, there are functions to rotate bits, find the number of consecutive

| Type | Description |
|--------|----------|
| [endian](bit-enum.md) | Specifies the endianness of scalar types. |
| [`endian`](bit-enum.md) | Specifies the endianness of scalar types. |

### Functions

| Function | Description |
|-----|-----|
|[bit_cast](bit-functions.md#bit_cast) | Reinterpret the object representation from one type to another. |
|[bit_ceil](bit-functions.md#bit_ceil) | Find the smallest power of two greater than or equal to a value. |
|[bit_floor](bit-functions.md#bit_floor) | Find the largest integral power of two not greater than a value. |
|[bit_width](bit-functions.md#bit_width) | Find the smallest number of bits needed to represent a value. |
|[countl_zero](bit-functions.md#countl_zero) | Count the number of consecutive bits set to zero, starting from the most significant bit. |
|[countl_one](bit-functions.md#countl_one) | Count the number of consecutive bits set to one, starting from the most significant bit. |
|[countr_zero](bit-functions.md#countr_zero) | Count the number of consecutive bits set to zero, starting from the least significant bit. |
|[countr_one](bit-functions.md#countl_one) | Count the number of consecutive bits set to one, starting from the least significant bit. |
|[has_single_bit](bit-functions.md#has_single_bit) | Check if a value has only a single bit set to one. This is the same as testing whether a value is a power of two. |
|[popcount](bit-functions.md#popcount) | Count the number of bits set to one. |
|[rotl](bit-functions.md#rotl) | Compute the result of a bitwise left-rotation. |
|[rotr](bit-functions.md#rotr) | Compute the result of a bitwise right-rotation. |
|[`bit_cast`](bit-functions.md#bit_cast) | Reinterpret the object representation from one type to another. |
|[`bit_ceil`](bit-functions.md#bit_ceil) | Find the smallest power of two greater than or equal to a value. |
|[`bit_floor`](bit-functions.md#bit_floor) | Find the largest integral power of two not greater than a value. |
|[`bit_width`](bit-functions.md#bit_width) | Find the smallest number of bits needed to represent a value. |
|[`countl_zero`](bit-functions.md#countl_zero) | Count the number of consecutive bits set to zero, starting from the most significant bit. |
|[`countl_one`](bit-functions.md#countl_one) | Count the number of consecutive bits set to one, starting from the most significant bit. |
|[`countr_zero`](bit-functions.md#countr_zero) | Count the number of consecutive bits set to zero, starting from the least significant bit. |
|[`countr_one`](bit-functions.md#countr_one) | Count the number of consecutive bits set to one, starting from the least significant bit. |
|[`has_single_bit`](bit-functions.md#has_single_bit) | Check if a value has only a single bit set to one. This is the same as testing whether a value is a power of two. |
|[`popcount`](bit-functions.md#popcount) | Count the number of bits set to one. |
|[`rotl`](bit-functions.md#rotl) | Compute the result of a bitwise left-rotation. |
|[`rotr`](bit-functions.md#rotr) | Compute the result of a bitwise right-rotation. |

## See also

Expand Down