Henryk said:
Your program will take like for ever ... ;o)
This is why my old school c programmer colleagues are so sceptical
about the performance of C++ and STL. You're never quite sure what's
going on under the hood of STL (unless you have some years experience).
The STL code looks nice and fancy but using lengthy loops where some
simple bit tests could do the same is not really efficient...
Cheers
That is a very naive way to approach software development. What
implementation is appropiate or "efficient" depends on the
circumstances. Bit tests are good if your information fits in a bit.
What if you have a set of objects? If you want a set that utilizes
bits, they are out there. The STL even has a couple, depending on
whether your set has a constant size or not. As for knowing what's
"under the hood," that's just silly. Do you know what's going on
under the hood of every library you use? Your C Library? Your OS?
Your compiler? The STL, like all good libraries, has a defined
interface. It even defines Big-O guarantees. It is tested and
portable. Re-invent the wheel when efficiency BECOMES a problem, not
before. I use C++ and the STL in real-time embedded systems without
any "efficiency" problems.
REH