You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-14Lines changed: 24 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,27 @@
4
4
5
5
**Contents**
6
6
7
-
-[Example usage](#example-usage)
8
-
-[In a nutshell](#in-a-nutshell)
9
-
-[License](#license)
10
-
-[Dependencies](#dependencies)
11
-
-[Installation](#installation)
12
-
-[Synopsis](#synopsis)
13
-
-[Features](#features)
14
-
-[Reported to work with](#reported-to-work-with)
15
-
-[Building the tests](#building-the-tests)
16
-
-[Other implementations of bit](#other-implementations-of-bit)
17
-
-[Notes and references](#notes-and-references)
18
-
-[Appendix](#appendix)
7
+
-[bit-lite - C++20 bit operations for C++98 and later in a single-file header-only library.](#bit-lite---c20-bit-operations-for-c98-and-later-in-a-single-file-header-only-library)
8
+
-[Example usage](#example-usage)
9
+
-[Compile and run](#compile-and-run)
10
+
-[In a nutshell](#in-a-nutshell)
11
+
-[License](#license)
12
+
-[Dependencies](#dependencies)
13
+
-[Installation](#installation)
14
+
-[Synopsis](#synopsis)
15
+
-[Documentation of standard header `<bit>`](#documentation-of-standard-header-bit)
-[A.2 Bit lite test specification](#a2-bit-lite-test-specification)
19
28
20
29
## Example usage
21
30
@@ -71,7 +80,7 @@ Bit width of 0x13: 5
71
80
72
81
### Documentation of standard header `<bit>`
73
82
74
-
Depending on the compiler and C++-standard used, *bit lite* behaves less or more like C++20 standard `<bit>`. To get an idea of the capabilities of *bit lite* with your configuration, look at the output of the [tests](test/bit.t.cpp), issuing `bit-main.t --pass @`. For C++20 standard `<bit>`, see its [documentation at cppreference](https://en.cppreference.com/w/cpp/header/bit).
83
+
Depending on the compiler and C++-standard used, *bit lite* behaves less or more like C++20 standard `<bit>`. To get an idea of the capabilities of *bit lite* with your configuration, look at the output of the [tests](test/bit.t.cpp), issuing `bit-main.t --pass @`. For C++20 standard `<bit>` and its C++23 extension, see its [documentation at cppreference](https://en.cppreference.com/w/cpp/header/bit).
75
84
76
85
### Non-standard extensions
77
86
@@ -153,12 +162,13 @@ The version of *bit lite* is available via tag `[.version]`. The following tags
153
162
154
163
```Text
155
164
bit_cast<>(): successfully roundtrips uint64_t via double [bit.cast]
165
+
byteswap(): allow to swap bytes in 1, 2, 4, 8-byte integrals [bit.byteswap]
156
166
has_single_bit(): single bit yields false for no bits set [bit.pow.two]
157
167
has_single_bit(): single bit yields true for single bits set [bit.pow.two]
158
168
has_single_bit(): single bit yields false for multiple bits set [bit.pow.two]
159
169
bit_ceil(): let N be the smallest power of 2 greater than or equal to x [bit.pow.two]
160
170
bit_floor(): x == 0, 0; otherwise the maximal value y such that has_single_bit(y) is true and y <= x [bit.pow.two]
161
-
bit_width: x == 0, 0; otherwise one plus the base-2 logarithm of x, with any fractional part discarded [bit.pow.two]
171
+
bit_width(): x == 0, 0; otherwise one plus the base-2 logarithm of x, with any fractional part discarded [bit.pow.two]
162
172
rotl(): r is 0, x; if r is positive, (x << r) | (x >> (N - r)); if r is negative, rotr(x, -r) [bit.rotate]
163
173
rotr(): r is 0, x; if r is positive, (x >> r) | (x << (N - r)); if r is negative, rotl(x, -r) [bit.rotate]
164
174
countl_zero(): the number of consecutive 0 bits in the value of x, starting from the most significant bit [bit.count]
0 commit comments