A Default
-like trait and derive macros for const
evaluation contexts.
This crate defines the ConstDefault
trait and implements it for
Rust primitives, prelude types, tuples and arrays. Furthermore it
provides a derive macro so that users can implement ConstDefault
easily for their custom types.
no_std
compatibleAdd
toml
[dependencies]
const-default = { version = "0.3", features = ["derive"] }
to your Cargo.toml
and start using it.
```rust use const_default::ConstDefault;
fn main() {
asserteq!(
```rust use const_default::ConstDefault;
pub struct Color { r: u8, g: u8, b: u8, }
fn main() {
assert_eq!(