File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ namespace detail {
35
35
struct runtime_error_fn {
36
36
private:
37
37
[[noreturn]]
38
- static inline void fail_fast ()
38
+ FLUX_ALWAYS_INLINE
39
+ static void fail_fast ()
39
40
{
40
41
#if FLUX_HAS_BUILTIN_TRAP
41
42
__builtin_trap ();
@@ -67,8 +68,9 @@ struct runtime_error_fn {
67
68
68
69
public:
69
70
[[noreturn]]
70
- inline void operator ()(char const * msg,
71
- std::source_location loc = std::source_location::current()) const
71
+ FLUX_ALWAYS_INLINE
72
+ void operator ()(char const * msg,
73
+ std::source_location loc = std::source_location::current()) const
72
74
{
73
75
if constexpr (config::on_error == error_policy::fail_fast) {
74
76
fail_fast ();
@@ -125,8 +127,7 @@ struct indexed_bounds_check_fn {
125
127
}
126
128
}
127
129
#endif
128
- assert_fn{}(idx >= T{0 }, " index cannot be negative" , loc);
129
- assert_fn{}(idx < limit, " out-of-bounds sequence access" , loc);
130
+ assert_fn{}(idx >= T{0 } && idx < limit, " out-of-bounds sequence access" , loc);
130
131
}
131
132
}
132
133
};
Original file line number Diff line number Diff line change 23
23
24
24
#define FLUX_DECLVAL (...) ((static_cast <__VA_ARGS__(*)()noexcept >(nullptr ))())
25
25
26
- #ifdef __GNUC__
27
- #define FLUX_ALWAYS_INLINE [[gnu::always_inline]]
26
+ #if defined(__GNUC__)
27
+ # define FLUX_ALWAYS_INLINE [[gnu::always_inline]] inline
28
+ #elif defined(_MSC_VER)
29
+ # define FLUX_ALWAYS_INLINE __forceinline
28
30
#else
29
- #define FLUX_ALWAYS_INLINE
31
+ # define FLUX_ALWAYS_INLINE inline
30
32
#endif
31
33
32
34
#define FLUX_NO_UNIQUE_ADDRESS [[no_unique_address]]
You can’t perform that action at this time.
0 commit comments