add const_assert for BitBoard
This commit is contained in:
7
Cargo.lock
generated
7
Cargo.lock
generated
@@ -170,6 +170,7 @@ dependencies = [
|
|||||||
"num",
|
"num",
|
||||||
"rand",
|
"rand",
|
||||||
"rayon",
|
"rayon",
|
||||||
|
"static_assertions",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -250,6 +251,12 @@ dependencies = [
|
|||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "static_assertions"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.98"
|
version = "2.0.98"
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ lazy_static = "1.5.0"
|
|||||||
num = "0.4"
|
num = "0.4"
|
||||||
rand = "0.9"
|
rand = "0.9"
|
||||||
rayon = "1.10"
|
rayon = "1.10"
|
||||||
|
static_assertions = "1.1.0"
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
use crate::board::BOARD_SIZE;
|
use crate::board::BOARD_SIZE;
|
||||||
|
use static_assertions::const_assert_eq;
|
||||||
|
|
||||||
|
// BitBoard should be big enough to fit all points on the board
|
||||||
|
const_assert_eq!(
|
||||||
|
std::mem::size_of::<BitBoard>() * 8,
|
||||||
|
(BOARD_SIZE * BOARD_SIZE)
|
||||||
|
);
|
||||||
|
|
||||||
/// 8x8
|
/// 8x8
|
||||||
/// TODO! look into variable length bit arrays in rust
|
/// TODO! look into variable length bit arrays in rust
|
||||||
|
|||||||
Reference in New Issue
Block a user