From cfa0b3a5a56ebbf8f9a983efd6e830b565d303a7 Mon Sep 17 00:00:00 2001 From: rhalbersma Date: Thu, 4 Jan 2024 19:33:02 +0100 Subject: [PATCH] Document clang support --- README.md | 8 ++++---- include/xstd/bit_set.hpp | 20 +++++++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 310afe8..c567f51 100644 --- a/README.md +++ b/README.md @@ -362,12 +362,12 @@ auto b = a This single-header library has no other dependencies than the C++ Standard Library and is continuously being tested with the following conforming [C++23](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf) compilers: | Platform | Compiler | Versions | Build | -| :------- | :------- | :------- | :---- | -| Linux | GCC | 14-trunk | CI currently being ported to GitHub Actions | -| Linux | Clang | 17, 18-SVN | CI currently being ported to GitHub Actions | +| :------- | :------- | -------: | :---- | +| Linux | GCC | 14-trunk | CI currently being ported to GitHub Actions | +| Linux | Clang | 17, 18-trunk | CI currently being ported to GitHub Actions | | Windows | Visual C++ | 17.3 | CI currently being ported to GitHub Actions | -Note that this library makes liberal use of C++23 features, such as `fold_left`, `pairwise_transform`, `to`, `zip`, `zip_transform` and `uz` literals for `size_t`. GCC 14-trunk, Clang 17 and Visual C++ 17.3 and higher are supported at the moment. Also note that running the unit tests requires the presence of the [range-v3](https://github.com/ericniebler/range-v3) library (for the set algorithm views). +Note that this library makes liberal use of C++23 features, such as the `fold_left`, `shift_left` and `shift_right` algorithms, the `pairwise_transform`, `zip` and `zip_transform` views, the `to` range conversion, the `uz` literal for `size_t` and the `unreachable` utility. GCC 14-trunk, Clang 17 and 18-trunk (both only with the GCC 14-trunk standard library) and Visual C++ 17.3 and higher are supported at the moment. Also note that running the unit tests requires the presence of the [range-v3](https://github.com/ericniebler/range-v3) library (for the set algorithm views). ## License diff --git a/include/xstd/bit_set.hpp b/include/xstd/bit_set.hpp index 3539508..af5d28c 100644 --- a/include/xstd/bit_set.hpp +++ b/include/xstd/bit_set.hpp @@ -23,7 +23,7 @@ // input_range #include // tie #include // common_type_t, is_class_v, make_signed_t -#include // forward, pair +#include // forward, pair, unreachable namespace xstd { @@ -541,8 +541,13 @@ class bit_set for (auto&& [lhs, rhs] : std::views::zip( m_data, m_data | std::views::drop(n_blocks) | std::views::pairwise_transform( - [=](auto first, auto second) -> block_type - { return (second << L_shift) | (first >> R_shift); } + [=](auto first, auto second) -> block_type + { + return + static_cast(second << L_shift) | + static_cast(first >> R_shift) + ; + } ) )) { lhs = rhs; @@ -570,8 +575,13 @@ class bit_set for (auto&& [lhs, rhs] : std::views::zip( m_data | std::views::reverse, m_data | std::views::reverse | std::views::drop(n_blocks) | std::views::pairwise_transform( - [=](auto first, auto second) -> block_type - { return (first << L_shift) | (second >> R_shift); } + [=](auto first, auto second) -> block_type + { + return + static_cast(first << L_shift) | + static_cast(second >> R_shift) + ; + } ) )) { lhs = rhs;