File tree Expand file tree Collapse file tree 5 files changed +4
-53
lines changed Expand file tree Collapse file tree 5 files changed +4
-53
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,6 @@ target_sources(bounded_test PRIVATE
123
123
FILES
124
124
test /assert.cpp
125
125
test /assert-NDEBUG.cpp
126
- test /assume.cpp
127
126
test /check_in_range.cpp
128
127
test /comparison.cpp
129
128
test /conditional.cpp
Original file line number Diff line number Diff line change 8
8
9
9
#include < std_module/prelude.hpp>
10
10
11
- #include < bounded/assume.hpp>
12
-
13
11
#include < cassert>
14
12
15
13
import bounded.constexpr_only_if;
16
14
import bounded.prevent_comma;
17
15
16
+ import std_module;
17
+
18
18
// An expression of type `void`. This is used to allow using variadic
19
19
// function-like macros to support expressions that contain commas, such as
20
20
// `BOUNDED_ASSERT(f<a, b>())`, but prevents expressions that look like two
@@ -25,7 +25,7 @@ import bounded.prevent_comma;
25
25
26
26
#if defined NDEBUG or defined BOUNDED_NDEBUG
27
27
#define BOUNDED_ASSERT (...) (std::is_constant_evaluated() ? ::bounded::detail::constexpr_only_if(__VA_ARGS__) : void ())
28
- #define BOUNDED_ASSERT_OR_ASSUME BOUNDED_ASSUME
28
+ #define BOUNDED_ASSERT_OR_ASSUME (...) [[assume(__VA_ARGS__)]]
29
29
#else
30
30
#define BOUNDED_ASSERT (...) (BOUNDED_DETAIL_PREVENT_COMMA(__VA_ARGS__), assert((__VA_ARGS__)))
31
31
#define BOUNDED_ASSERT_OR_ASSUME BOUNDED_ASSERT
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ struct integer {
178
178
using underlying_type = underlying_type_t <minimum, maximum>;
179
179
180
180
constexpr auto value () const -> underlying_type {
181
- BOUNDED_ASSUME (minimum <= m_value and m_value <= maximum);
181
+ [[ assume (minimum <= m_value and m_value <= maximum)]] ;
182
182
return m_value;
183
183
}
184
184
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments