diff --git a/README.md b/README.md index 8fdf781..2d40dce 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Some of the extras are available only with C++20 or later. *stdx* supports: -- clang 14 through 19 +- clang 14 through 20 - gcc 12 through 14 See the [full documentation](https://intel.github.io/cpp-std-extensions/). diff --git a/docs/bit.adoc b/docs/bit.adoc index 2b7205e..db5ea96 100644 --- a/docs/bit.adoc +++ b/docs/bit.adoc @@ -125,8 +125,8 @@ integral type that will fit a compile-time value. [source,cpp] ---- -constexpr auto x = stdx::smallest_uint<42>(); // std::uint8_t{} -constexpr auto y = stdx::smallest_uint<1337>(); // std::uint16_t{} +constexpr auto x = stdx::smallest_uint<42>(); // std::uint8_t{42} +constexpr auto y = stdx::smallest_uint<1337>(); // std::uint16_t{1337} // smallest_uint_t is the type of a call to smallest_uint using T = stdx::smallest_uint_t<1337>; // std::uint16_t diff --git a/docs/byterator.adoc b/docs/byterator.adoc index 61f7004..eabb992 100644 --- a/docs/byterator.adoc +++ b/docs/byterator.adoc @@ -72,6 +72,10 @@ i.writeu16(v16); // write and advance auto v32 = i.peeku32(); // read value without advancing v32 = i.readu32(); // read and advance i.writeu32(v32); // write and advance + +auto v64 = i.peeku64(); // read value without advancing +v64 = i.readu64(); // read and advance +i.writeu64(v64); // write and advance ---- These convenience functions are implemented by function templates that offer diff --git a/docs/intro.adoc b/docs/intro.adoc index 235683e..6736058 100644 --- a/docs/intro.adoc +++ b/docs/intro.adoc @@ -21,8 +21,11 @@ The following compilers are supported: * clang 16 * clang 17 * clang 18 +* clang 19 +* clang 20 * gcc 12 * gcc 13 +* gcc 14 In general, `stdx` supports the C++17 standard; however some functionality is available only in 20 and later. diff --git a/include/stdx/bit.hpp b/include/stdx/bit.hpp index 657f555..58c8ff5 100644 --- a/include/stdx/bit.hpp +++ b/include/stdx/bit.hpp @@ -421,13 +421,13 @@ template constexpr auto bit_size() -> std::size_t { template CONSTEVAL auto smallest_uint() { if constexpr (N <= std::numeric_limits::digits) { - return std::uint8_t{}; + return std::uint8_t{N}; } else if constexpr (N <= std::numeric_limits::digits) { - return std::uint16_t{}; + return std::uint16_t{N}; } else if constexpr (N <= std::numeric_limits::digits) { - return std::uint32_t{}; + return std::uint32_t{N}; } else { - return std::uint64_t{}; + return std::uint64_t{N}; } }