Skip to content

Commit b3899e8

Browse files
authored
Merge pull request #223 from elbeno/update-docs
Update documentation for `byterator`
2 parents 643dea1 + 006cef9 commit b3899e8

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Some of the extras are available only with C++20 or later.
1111

1212
*stdx* supports:
1313

14-
- clang 14 through 19
14+
- clang 14 through 20
1515
- gcc 12 through 14
1616

1717
See the [full documentation](https://intel.github.io/cpp-std-extensions/).

docs/bit.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ integral type that will fit a compile-time value.
125125

126126
[source,cpp]
127127
----
128-
constexpr auto x = stdx::smallest_uint<42>(); // std::uint8_t{}
129-
constexpr auto y = stdx::smallest_uint<1337>(); // std::uint16_t{}
128+
constexpr auto x = stdx::smallest_uint<42>(); // std::uint8_t{42}
129+
constexpr auto y = stdx::smallest_uint<1337>(); // std::uint16_t{1337}
130130
131131
// smallest_uint_t is the type of a call to smallest_uint
132132
using T = stdx::smallest_uint_t<1337>; // std::uint16_t

docs/byterator.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ i.writeu16(v16); // write and advance
7272
auto v32 = i.peeku32(); // read value without advancing
7373
v32 = i.readu32(); // read and advance
7474
i.writeu32(v32); // write and advance
75+
76+
auto v64 = i.peeku64(); // read value without advancing
77+
v64 = i.readu64(); // read and advance
78+
i.writeu64(v64); // write and advance
7579
----
7680

7781
These convenience functions are implemented by function templates that offer

docs/intro.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ The following compilers are supported:
2121
* clang 16
2222
* clang 17
2323
* clang 18
24+
* clang 19
25+
* clang 20
2426
* gcc 12
2527
* gcc 13
28+
* gcc 14
2629

2730
In general, `stdx` supports the C++17 standard; however some functionality is
2831
available only in 20 and later.

include/stdx/bit.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,13 @@ template <typename T> constexpr auto bit_size() -> std::size_t {
421421

422422
template <std::size_t N> CONSTEVAL auto smallest_uint() {
423423
if constexpr (N <= std::numeric_limits<std::uint8_t>::digits) {
424-
return std::uint8_t{};
424+
return std::uint8_t{N};
425425
} else if constexpr (N <= std::numeric_limits<std::uint16_t>::digits) {
426-
return std::uint16_t{};
426+
return std::uint16_t{N};
427427
} else if constexpr (N <= std::numeric_limits<std::uint32_t>::digits) {
428-
return std::uint32_t{};
428+
return std::uint32_t{N};
429429
} else {
430-
return std::uint64_t{};
430+
return std::uint64_t{N};
431431
}
432432
}
433433

0 commit comments

Comments
 (0)