static_assert without message is C++17

This commit is contained in:
Raphael Coeffic
2022-04-03 07:40:30 +02:00
parent d7d1e446bd
commit 581cb257c6
+1 -1
View File
@@ -127,7 +127,7 @@ void copyToTerminated(char (&dest)[DL], const char (&src)[SL],
static_assert(dl > 0, "wrong sizes or offset");
static constexpr size_t len = (dl < SL) ? dl : SL;
strncpy(&dest[O], &src[0], len);
static_assert((len + O) < DL);
static_assert((len + O) < DL, "wrong sizes of offset");
dest[len + O] = '\0';
}