File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
1717See the [ full documentation] ( https://intel.github.io/cpp-std-extensions/ ) .
Original file line number Diff line number Diff 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
132132using T = stdx::smallest_uint_t<1337>; // std::uint16_t
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ i.writeu16(v16); // write and advance
7272auto v32 = i.peeku32(); // read value without advancing
7373v32 = i.readu32(); // read and advance
7474i.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
7781These convenience functions are implemented by function templates that offer
Original file line number Diff line number Diff 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
2730In general, `stdx` supports the C++17 standard; however some functionality is
2831available only in 20 and later.
Original file line number Diff line number Diff line change @@ -421,13 +421,13 @@ template <typename T> constexpr auto bit_size() -> std::size_t {
421421
422422template <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
You can’t perform that action at this time.
0 commit comments