Tag Info

New answers tagged

7

@Gábor has already explained the connection (contravariance for all that goes "in", covariance for all that goes "out"), but why re-use keywords at all? Well, keywords are very expensive. You cannot use them as identifiers in your programs. But there is only so many words in the English language. So, sometimes you run into conflicts, and you have to ...


12

There is a connection, however it is a little loose. In C# the keywords ´in´ and ´out´ as their name suggest stand for input and output. This is very clear in the case of output parameters, but less clean what it have to do with template parameters. Lets take a look at the Liskov substitution principle: ... Liskov's principle imposes some standard ...



Top 50 recent answers are included