在了解了const泛型并偶然发现了typenum
个 crate 之后,我被它们似乎有一个重叠的目的-使用数值作为类型-这一事实搞糊涂了.
唯一的区别是typenum
提供了更多的灵活性,比如对数字类型的算术运算,但不那么直观和符合人体工程学的用法.在常量泛型出现之前,typenum
就已经存在了,而typenum
中的许多特性似乎正在讨论是否要添加到常量泛型语法中.
I couldn't find anything explaining the relation between these two, but all the things above is leading me to the conclusion:
"typenum
is a bandage fix to the current limitations of const generics".
这样对吗?是否有超过typenum
个超出常量泛型的范围,或者一旦其功能和语法更加成熟,它最终会被常量泛型完全取代吗?