diff options
author | Brotcrunsher <Brotcrunsher@hotmail.de> | 2023-06-22 01:31:06 +0200 |
---|---|---|
committer | Brotcrunsher <Brotcrunsher@hotmail.de> | 2023-06-22 01:31:06 +0200 |
commit | 5fc4939e17509534eb36727b27ac0afb941e44f7 (patch) | |
tree | c099fd38b4b228b054ec22b7a4bbfbac5b94cfe6 /src/prevector.h | |
parent | 8f402710371a40c5777dc3f9c4ba6ca8505a2f90 (diff) |
Added static_assert to check that base_blob is using whole bytes.
Prior to this commit it was possible to create base_blobs with any arbitrary amount of bits, like base_blob<9>. One could assume that this would be a valid way to create a bit field that guarantees to have at least 9 bits. However, in such a case, base_blob would not behave as expected because the WIDTH is rounded down to the closest whole byte (simple integer division by 8). This commit makes sure that this oddity is detected and blocked by the compiler.
Diffstat (limited to 'src/prevector.h')
0 files changed, 0 insertions, 0 deletions