Skip to content

Commit

Permalink
Document clang support
Browse files Browse the repository at this point in the history
  • Loading branch information
rhalbersma committed Jan 4, 2024
1 parent 99e9cc8 commit cfa0b3a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 15 additions & 5 deletions include/xstd/bit_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// input_range
#include <tuple> // tie
#include <type_traits> // common_type_t, is_class_v, make_signed_t
#include <utility> // forward, pair
#include <utility> // forward, pair, unreachable

namespace xstd {

Expand Down Expand Up @@ -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<block_type>(second << L_shift) |
static_cast<block_type>(first >> R_shift)
;
}
)
)) {
lhs = rhs;
Expand Down Expand Up @@ -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<block_type>(first << L_shift) |
static_cast<block_type>(second >> R_shift)
;
}
)
)) {
lhs = rhs;
Expand Down

0 comments on commit cfa0b3a

Please sign in to comment.