#![feature(generic_const_exprs)]
use generic_predicates::generic_predicates;
generic_predicates! {
pub fn foo<const N: usize>()
where
(N > 23, "`N` must be greater than 23")
{
}
}
fn main() {
// This compiles.
foo::<24>();
// This doesn't.
foo::<23>();
}
A taste of what const generics could enable in the future
License
lachlansneff/generic-predicates
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A taste of what const generics could enable in the future
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published