Files
cppdraft_translate/cppdraft/bit/byteswap.md
2025-10-25 03:02:53 +03:00

1.2 KiB

[bit.byteswap]

22 General utilities library [utilities]

22.11 Bit manipulation [bit]

22.11.4 byteswap [bit.byteswap]

🔗

template<class T> constexpr T byteswap(T value) noexcept;

1

#

Constraints: T models integral.

2

#

Mandates: T does not have padding bits ([basic.types.general]).

3

#

Let the sequence R comprise the bytes of the object representation of value in reverse order.

4

#

Returns: An object v of type T such that each byte in the object representation of v is equal to the byte in the corresponding position in R.