wrote:
> flopbucket wrote:
>
> Probably stating the obvious for quite a few people here, but why not
> buy
> such a library? IIRC, Dinkumware has such a lib.
Yes, that certainly was an option. We looked at a few freely available
ones, such as STLport, but they were too large, needed a more complete
C library then the platform provides, etc. We discussed possibly
purchasing one - we found at least one "mini" STL product for embedded
environments, but in the end, the decision was to roll our own minimal
implementation for the time being (part of this had to do with special
memory constraints, non-standard platform API for allocation, etc.,
although I suppose we could have made a custom allocator to solve most
of this).
The group decided they just wanted a few containers (vector, string,
list) so that's how I ended up doing this work. For the parts
implemented, it matches the standard so hopefully in the future the
custom code can be switched out if our platform vendor ever ships a
more complete library. And while I was outside the decision loop, I
must admit I have enjoyed this work as I got a chance to dig into some
implementation details and get a better understanding of the STL.
I have not looked too closely at the Dinkumware library, perhaps it
could have fit our needs. However, we really needed pretty much
standalone containers. We didn't want to have to pull in lots of other
code and dependencies or modify the supplied 3rd party code. For
example, having operator<< defined for std::string would require us to
remove it since that would depend on iostreams, and there is no way we
could build that given our very limited C library (nor would we want
to, there is no display or anything on our device).