tmp/tmphvv79wzu/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Header `<bit>` synopsis <a id="bit.syn">[[bit.syn]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
// [bit.cast], bit_cast
|
| 6 |
+
template<class To, class From>
|
| 7 |
+
constexpr To bit_cast(const From& from) noexcept;
|
| 8 |
+
|
| 9 |
+
// [bit.pow.two], integral powers of 2
|
| 10 |
+
template<class T>
|
| 11 |
+
constexpr bool has_single_bit(T x) noexcept;
|
| 12 |
+
template<class T>
|
| 13 |
+
constexpr T bit_ceil(T x);
|
| 14 |
+
template<class T>
|
| 15 |
+
constexpr T bit_floor(T x) noexcept;
|
| 16 |
+
template<class T>
|
| 17 |
+
constexpr T bit_width(T x) noexcept;
|
| 18 |
+
|
| 19 |
+
// [bit.rotate], rotating
|
| 20 |
+
template<class T>
|
| 21 |
+
[[nodiscard]] constexpr T rotl(T x, int s) noexcept;
|
| 22 |
+
template<class T>
|
| 23 |
+
[[nodiscard]] constexpr T rotr(T x, int s) noexcept;
|
| 24 |
+
|
| 25 |
+
// [bit.count], counting
|
| 26 |
+
template<class T>
|
| 27 |
+
constexpr int countl_zero(T x) noexcept;
|
| 28 |
+
template<class T>
|
| 29 |
+
constexpr int countl_one(T x) noexcept;
|
| 30 |
+
template<class T>
|
| 31 |
+
constexpr int countr_zero(T x) noexcept;
|
| 32 |
+
template<class T>
|
| 33 |
+
constexpr int countr_one(T x) noexcept;
|
| 34 |
+
template<class T>
|
| 35 |
+
constexpr int popcount(T x) noexcept;
|
| 36 |
+
|
| 37 |
+
// [bit.endian], endian
|
| 38 |
+
enum class endian {
|
| 39 |
+
little = see below,
|
| 40 |
+
big = see below,
|
| 41 |
+
native = see below
|
| 42 |
+
};
|
| 43 |
+
}
|
| 44 |
+
```
|
| 45 |
+
|