Forgot your password?
typodupeerror

Comment Re:a 'few' rough edges (Score 1) 661

If those are the motivations, we should have an ImmutableList class without an add function, and derive the List with an add function from it (in C++, probably by private inheritance, that is, inheritance of implementation). Only the List class with the (working) add should publically inherit from the interface with an add function.

This is a bad solution. If List inherits from ImmutableList, this implies that List is an ImmutableList. Since that is not the case, this is obviously a bad design.

Also, your solution would be impossible to implement if you don't have control over the List class. For example, the List class could be a part of a component you can't modify, or even a part of your programming language.

Slashdot Top Deals

Beware the new TTY code!

Working...