Enforces type T to be in an invariant position. For example Invariant<Square> cannot be assigned to type Invariant<Polygon> or vice versa.
Invariant<Square>
Invariant<Polygon>
This should be used when an interface with type parameter T does not explicitly use T in an invariant position, but the interface implies inout T.
inout T
https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
Enforces type T to be in an invariant position. For example
Invariant<Square>cannot be assigned to typeInvariant<Polygon>or vice versa.This should be used when an interface with type parameter T does not explicitly use T in an invariant position, but the interface implies
inout T.https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)