4 ms·
"Can I guarantee every function that expects a T to behave exactly the same way when I pass a P instead (where P is a subclass of T)?" For those who don't know
by deliminator 13y ago
"Can I guarantee every function that expects a T to behave exactly the same way when I pass a P instead (where P is a subclass of T)?"
For those who don't know, that's the Liskov Substitution Principle [1]
[1] http://en.wikipedia.org/wiki/Liskov_substitution_principle http://en.wikipedia.org/wiki/Liskov_substitution_principle