有没有办法在 where 子句中定义一个 const generic,目前似乎不起作用。如果没有的话,以后有计划添加吗?
fn foo<N>()
where
const N:usize,
{}
fn foo<const N>()
where
N:usize
{}
这是不可能的,也没有计划添加它。 如参考文献中所述,常量泛型始终遵循模式
const IDENTIFIER : Type ( = Block | IDENTIFIER | -?LITERAL )?