blob: 6514409698e3e6fda6c46dfd28083691563207f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
#![allow(incomplete_features)]
pub struct Defaulted<const N: usize=3>;
impl Defaulted {
pub fn new() -> Self {
Defaulted
}
}
impl<const N: usize> Defaulted<N> {
pub fn value(&self) -> usize {
N
}
}
|