2 ms·
The number of existing actual set operations available on std Set is so low that that’s basically the same thing as creating your own custom Set over the std Se
by ComputerGuru 3y ago
The number of existing actual set operations available on std Set is so low that that’s basically the same thing as creating your own custom Set over the std Set via plain, old composition.
- galaxyLogic 3y agoThat is why the new Set proposal is welcome. But my point is when you code an application you are not coding a library, but an app, so you only need to add the methods your app needs. You probably don't need to create an all-encompassing new Set-implementation that wins the library-of-the-year award. :-) Maybe you just need to add a method named 'eq()'. An added benefit of creating your own Set-subclass is you can put debugger-statements in its code to observe who uses it and how. You can put assertions in it to ensure only correct type of elements can be added to it etc.