Skip to content

Commit

Permalink
Add GCC 12, 13 (#15)
Browse files Browse the repository at this point in the history
* Update cmake-multi-platform.yml

* Update common_iterator.h

* Update unreachable_sentinel.h

* Update README.md
  • Loading branch information
lackhole authored Jun 21, 2024
1 parent 3c1b955 commit a633094
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,23 @@ jobs:
os: [ubuntu-latest]
build_type: [Debug, Release]
compiler: [gcc]
compiler_version: [9, 10, 11]
compiler_version: [9, 10, 11, 12, 13]
include:
- cc_compiler: gcc
- cxx_compiler: g++

steps:
- uses: actions/checkout@v4

- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.compiler_version }}

- name: Configure CMake
env:
CC: ${{ matrix.cc_compiler }}-${{ matrix.compiler_version }}
CXX: ${{ matrix.cxx_compiler }}-${{ matrix.compiler_version }}
CC: gcc
CXX: g++
run: >
cmake -B build
-DCMAKE_CXX_COMPILER=${{ env.CXX }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ int main() {
| Compiler | Minimum version tested | Maximum version tested |
|-------------|---------------------------------------|---------------------------------------|
| MSVC | 19.29.30154.0 (Visual Studio 16 2019) | 19.40.33811.0 (Visual Studio 17 2022) |
| gcc | 9.5.0 | 11.4.0 |
| clang | 13.0.1 | 15.0.7 |
| gcc | 9.5.0 | 13.1.0 |
| clang | 11.1.0 | 15.0.7 |
| Apple clang | 14.0.0.14000029 | 15.0.0.15000040 (Silicon) |
| Android NDK | r18 (clang 7.0) | r26 (clang 17.0.2) |
| Emscripten | 3.1.20 (clang 16.0.0) | latest(3.1.61) (clang 19.0.0) |
Expand Down
8 changes: 4 additions & 4 deletions include/preview/__iterator/common_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class common_iterator {
{
switch (x.var_.index()) {
case 0:
var_.emplace<0>(detail::variant_raw_get(x.var_._base().storage(), in_place_index<0>));
var_.template emplace<0>(detail::variant_raw_get(x.var_._base().storage(), in_place_index<0>));
break;
case 1:
var_.emplace<1>(detail::variant_raw_get(x.var_._base().storage(), in_place_index<1>));
var_.template emplace<1>(detail::variant_raw_get(x.var_._base().storage(), in_place_index<1>));
break;
default:
break;
Expand Down Expand Up @@ -125,10 +125,10 @@ class common_iterator {

switch (x.var_.index()) {
case 0:
var_.emplace<0>(detail::variant_raw_get(x._base().storage(), in_place_index<0>));
var_.template emplace<0>(detail::variant_raw_get(x._base().storage(), in_place_index<0>));
break;
case 1:
var_.emplace<1>(detail::variant_raw_get(x._base().storage(), in_place_index<1>));
var_.template emplace<1>(detail::variant_raw_get(x._base().storage(), in_place_index<1>));
break;
default:
break;
Expand Down
18 changes: 18 additions & 0 deletions include/preview/__iterator/unreachable_sentinel.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ struct unreachable_sentinel_t {
operator==(unreachable_sentinel_t, const I&) noexcept {
return false;
}

template<typename I>
friend constexpr std::enable_if_t<weakly_incrementable<I>::value, bool>
operator==(const I&, unreachable_sentinel_t) noexcept {
return false;
}

template<typename I>
friend constexpr std::enable_if_t<weakly_incrementable<I>::value, bool>
operator!=(unreachable_sentinel_t, const I&) noexcept {
return false;
}

template<typename I>
friend constexpr std::enable_if_t<weakly_incrementable<I>::value, bool>
operator!=(const I&, unreachable_sentinel_t) noexcept {
return false;
}
};

PREVIEW_INLINE_VARIABLE constexpr unreachable_sentinel_t unreachable_sentinel{};
Expand Down

0 comments on commit a633094

Please sign in to comment.