Closed LEXUGE closed 5 years ago
impl<T: A + B> C for T
Figure 3-5 is wrong because the trait C should be implemented for All the T where T∈(A∩B)
C
T∈(A∩B)
(A∩B)⊂C should be true else the code can't compile. And (A∩B)⊂T can always be true since T had implemented A and B.
(A∩B)⊂C
(A∩B)⊂T
A
B
页码与行数
文本或排版错误
Figure 3-5 is wrong because the trait
C
should be implemented for All the T whereT∈(A∩B)
(A∩B)⊂C
should be true else the code can't compile. And(A∩B)⊂T
can always be true since T had implementedA
andB
.