
11 May
2010
11 May
'10
6:35 p.m.
Le 11/05/2010 19:30, John Dlugosz wrote:
Consider a class derived from an STL collection.
You should never do that.
It features a special find(x) function that works with his search criteria. It returns an iterator into the collection. There are two forms needed: iterator find(x); const_iterator find(x) const; and the annoying part is that they contain exactly the same code. The implementation uses the inherited iterators and collection features to do the finding.
The larger question is, is there a better way to approach that?
Macros?