Anonymous user
Constrained genericity: Difference between revisions
m
→{{header|Objective-C}}
(added objc) |
|||
Line 681:
@end</lang>
Type constraints in type parameters can be made via the <code>:</code> keyword, indicating in this case that the type argument must be a type that is a subtype of <code>id<Eatable></code>.
<lang objc>@interface FoodBox<T : id<Eatable>> : NSObject
@end</lang>
|