Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #11183
| From | Tom <no@email.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Extending Template Classes - Best Practices |
| Date | 2011-11-02 00:08 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <877h3j1j48.fsf@chomsky.home> (permalink) |
Hi, I am trying to understand best practices in extending template container classes. Say one has implemented an effecient parameterised tree container that does not allow for duplicate values. Let us further assume the tree method is parameterised by a single type T and a functional C . The functional defines an order relation on the tree and is provided a default value say std::less< T >. The tree interface supports a minimal interface, providing insert, and remove methods. One would now like to implement a parameterised Set container. Let us suppose there are two cases here - The set supports the same interface - insert/remove but with slightly different implementation from the tree - The set supports and augmented interface - insert/remove (with no change in implementation), and additional methods such as union intersection and complement. In either case what is the appropriate approach, i.e set composes tree or set inherits tree or tree is also parameterised by another type (traits ?) that makes it behave as a set alternatively ? What would be a good resource (book/website) to learn more about such issues in developing parameterised classes and complexities of name lookup rules for parameterised class hierarchies. regards Tom
Back to comp.lang.c++ | Previous | Next — Next in thread | Find similar | Unroll thread
Extending Template Classes - Best Practices Tom <no@email.com> - 2011-11-02 00:08 +0000 Re: Extending Template Classes - Best Practices "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-02 03:37 +0100 Re: Extending Template Classes - Best Practices Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-02 06:05 +0000
csiph-web