diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-13 14:10:14 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-13 14:24:34 +0100 |
| commit | 89624beacd9becff81f28a0f9011f708fc784d42 (patch) | |
| tree | c40c6cffd1b882342061a21b4e978c707fb7a1d5 | |
| parent | 264e24ea87fb9d529f65f0e1e09fc6c3a93db3c9 (diff) | |
c
| -rw-r--r-- | serialize/packbits.cpp | 2 | ||||
| -rw-r--r-- | serialize/packbits.hpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/serialize/packbits.cpp b/serialize/packbits.cpp index 4623d0d9..83828f66 100644 --- a/serialize/packbits.cpp +++ b/serialize/packbits.cpp @@ -7,6 +7,8 @@ using namespace floormat::detail_Pack; namespace { +static_assert(!Storage<uint8_t, 0>{42}.check_zero()); + constexpr bool test1() { constexpr size_t bits[] = { 5, 2, 1 }; diff --git a/serialize/packbits.hpp b/serialize/packbits.hpp index e730770f..cb91602f 100644 --- a/serialize/packbits.hpp +++ b/serialize/packbits.hpp @@ -78,8 +78,8 @@ struct Storage<T, 0> template<size_t N> struct next { - static_assert(!std::is_same_v<T, void>, "reading past the end"); - static_assert( std::is_same_v<T, void>, "reading past the end"); + static_assert(N == 0, "reading past the end"); + static_assert(N != 0, "reading past the end"); }; }; |
