Skip to content

lachlansneff/generic-predicates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A taste of what const generics could enable in the future

#![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>();
}

About

A taste of what const generics could enable in the future

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages