Skip to content

Commit ba62d07

Browse files
committed
Workaround problem with static_assert(false) in gcc/clang compilers
1 parent 216fb3e commit ba62d07

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/common/utils_proto.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ namespace fb_utils
275275
bool isBpbSegmented(unsigned parLength, const unsigned char* par);
276276

277277

278+
// Workaround, to be removed with C++ 23
279+
template <typename... T>
280+
constexpr bool fb_always_false_v = false;
281+
278282
// Put integer value into info buffer
279283
template<typename T>
280284
inline unsigned char* putInfoItemInt(const unsigned char item, T value,
@@ -308,7 +312,7 @@ namespace fb_utils
308312
else if constexpr (len == sizeof(char))
309313
*ptr = value;
310314
else
311-
static_assert(always_false<T>::value, "unknown data type");
315+
static_assert(fb_always_false_v<T>, "unknown data type");
312316

313317
ptr += len;
314318
return ptr;

0 commit comments

Comments
 (0)