Skip to content

Commit d1f1705

Browse files
committed
allow c++20
1 parent 212c829 commit d1f1705

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/ci_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
c: gcc
3838
- cpp: clang++
3939
c: clang
40-
cpp_version: [23]
40+
cpp_version: [20, 23]
4141
cmake_args:
4242
- description: "Default"
4343
args: ""
@@ -50,7 +50,7 @@ jobs:
5050
compiler:
5151
cpp: g++
5252
c: gcc
53-
cpp_version: 23
53+
cpp_version: 20
5454
cmake_args:
5555
description: "Dynamic"
5656
cmake_args: "-DBUILD_SHARED_LIBS=on"

include/beman/inplace_vector/inplace_vector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ template <class = void>
312312
[[noreturn]]
313313
static constexpr void __assert_failure(char const *__file, int __line,
314314
char const *__msg) {
315-
if consteval {
315+
if (std::is_constant_evaluated()) {
316316
throw __msg; // TODO: std lib implementer, do better here
317317
} else {
318318
fprintf(stderr, "%s(%d): %s\n", __file, __line, __msg);

tests/beman/inplace_vector/ref_impl.test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <iostream>
2121
#include <memory>
2222
#include <string>
23+
#include <type_traits>
2324
#include <vector>
2425

2526
#define CHECK(...) \
@@ -183,7 +184,7 @@ template <typename T, std::size_t N> constexpr void test_il_constructor() {
183184
for (size_t i = 0; i < N; ++i)
184185
CHECK(v[i] == T(i));
185186
CHECK(11 > N);
186-
if !consteval {
187+
if (!std::is_constant_evaluated()) {
187188
CHECK_THROWS(
188189
([&] { const vector<T, N> x({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}); }()),
189190
std::bad_alloc);
@@ -212,7 +213,7 @@ template <typename T, std::size_t N> constexpr void test_il_assignment() {
212213
CHECK(v.size() == N);
213214
for (size_t i = 0; i < N; ++i)
214215
CHECK(v[i] == T(i));
215-
if !consteval {
216+
if (!std::is_constant_evaluated()) {
216217
CHECK_THROWS(([&] {
217218
[[maybe_unused]] const vector<T, N> x = {0, 1, 2, 3, 4, 5,
218219
6, 7, 8, 9, 10};

0 commit comments

Comments
 (0)