File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 6969 }
7070}
7171
72+ impl < const N : usize > core:: ops:: Sub < Const < N > > for usize {
73+ type Output = usize ;
74+ fn sub ( self , _: Const < N > ) -> Self :: Output {
75+ self . size ( ) - N
76+ }
77+ }
78+ impl < const N : usize > core:: ops:: Sub < usize > for Const < N > {
79+ type Output = usize ;
80+ fn sub ( self , rhs : usize ) -> Self :: Output {
81+ N - rhs. size ( )
82+ }
83+ }
84+
85+ #[ cfg( feature = "nightly" ) ]
86+ impl < const N : usize , const M : usize > core:: ops:: Sub < Const < N > > for Const < M >
87+ where
88+ Const < { M - N } > : Sized ,
89+ {
90+ type Output = Const < { M - N } > ;
91+ fn sub ( self , _: Const < N > ) -> Self :: Output {
92+ Const
93+ }
94+ }
95+
7296impl < const N : usize > core:: ops:: Mul < Const < N > > for usize {
7397 type Output = usize ;
7498 fn mul ( self , _: Const < N > ) -> Self :: Output {
You can’t perform that action at this time.
0 commit comments