“Robert Rutherford” <ruzz@NoSpamPlease.ruzz.com> wrote in message
Ok… I really didn’t want to start a religious war about what should or
shouldn’t be included in a C++ library that is intended for embedded
Probably a good idea. But I’d expect that the modifications made were based
on actually testing their effect on code size rather than guessing - who
knows the compiler used though. Dinkumware could certainly spend a bit of
time improving compile time and code size of their regular library - others
have proved that it is possible.
I was coming from the perspective of someone who was merely looking for
light at the end of the “it takes 10 times longer to compile” tunnel. It
been mentioned that the “Abridged” library might provide that, but it
that it only does so at the expense of compatibility with our existing
base. This is too high a price to pay >
My compile times seemed to drop by nearly 50% (I’ll have to actually do some
timing on this) and executable sizes dropped by a similar amount. My code is
very template intensive however - others might fare better.
How hard would it be to take the non-templated strings implementation out
the Abridged library and use it with the standard library? I suspect this
would buy some (a lot of?) improvement on its own.
You’d need the non-templated iostreams too.
I actually found that my code required very few changes. Nowhere have I ever
used fstream (always ifstream and ofstream) but in a few places I use
stringstream, which has had to move to an inefficient ostringstream and then
istringstream. Other than that, the missing header gave me grief,
so I ported the one from the full Dinkumware library; only a few lines
required changing to reflect the fact that strings and streams aren’t
templated. Finally, I had to remove a bit of custom locale facet code -
locales are also completely dropped from the Abridged lib.
I’ve found two bugs though - ostream_iterator (or what it i?) has a missing
default template argument, and is missing include guards.
So I got a substantial C++ code base that uses the C++ standard library
throughout compiling with the Abridged library in about 1 hour. I wouldn’t
have thought that most people would have a big problem either - the whole
STL component is basically unchanged and to fix the rest simply requires a
grep on cerr, fstream and stringstream. If you use wchar_t, locales or the
template features of strings and streams, the porting process will be more