This has got to be one of the best outcomes of sickness in computing history!
I love STL, it's the major reason I stick with C++ rather than switching to Java et al. It is extremely well thought-out and most algorithms have clear complexity guarantees. I think it forms an example that libraries in other languages should strive for.
I agree with your opinion about the STL it is indeed very well thought-out and very efficient. It is a shame that concept did not make it into C++0x[1] as it could had help STL usage by preventing the cryptic errors[2]
[1] For very good reason, I understood.
[2] STLFilt can help though http://www.bdsoft.com/tools/stlfilt.html
//for each element in vector v
vector<T>::const_iterator it;
for(it = v.begin(); it != v.end(); ++it)
{
...
}
or // if there is element Value in vector v
if(find(v.begin(), v.end(), Value) != v.end())
{
...
}
I'm not talking about what pain it's, to write your own custom iterators.I ended up using my own macros to cover verboseness of STL. Boost also provide some macros to ease working with STL, like FOREACH.
In a nutshell STL is a hack stretching pointer/iterator concept to generic algorithms and data structures on the host OOP language.
The best generic data structures library I saw, was in Clu language. Clu is all about ADT (Abstract Data Types).
Absence of closures in current C++ implementation also not very favorable for generic programming.
Coming up with something which was at the time entirely against mainstream practices and imbue it into the standard of a language as widely used as C++ takes a very special kind of person/s.