Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(dead_code, unused_variables)]
- #![feature(const_generics)]
- const fn square(x: usize) -> usize {
- x * x
- }
- fn compiletime<const N: usize>() -> usize {
- N
- }
- fn main() {
- let x = compiletime::<{
- square(4) + square(10)
- }>();
- println!("{}", x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement