From 860c270c73048b4930ac8cbebcd60be746eb9782 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sun, 27 Dec 2020 10:44:22 +0000 Subject: Codechange: Replace assert_compile macro with static_assert --- src/cmd_helper.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cmd_helper.h') diff --git a/src/cmd_helper.h b/src/cmd_helper.h index a505c1fd8..ceb4d4bd9 100644 --- a/src/cmd_helper.h +++ b/src/cmd_helper.h @@ -24,9 +24,9 @@ template static inline T Extract(U v) { /* Check if there are enough bits in v */ - assert_compile(N == EnumPropsT::num_bits); - assert_compile(S + N <= sizeof(U) * 8); - assert_compile(EnumPropsT::end <= (1 << N)); + static_assert(N == EnumPropsT::num_bits); + static_assert(S + N <= sizeof(U) * 8); + static_assert(EnumPropsT::end <= (1 << N)); U masked = GB(v, S, N); return IsInsideMM(masked, EnumPropsT::begin, EnumPropsT::end) ? (T)masked : EnumPropsT::invalid; } -- cgit v1.2.3-54-g00ecf