Gernot said:
I've used STL for a long time now, but only used spirit from boost.
Because spirit didn't succeed with older compilers, I didn't want to
VC6 is soon to be 3 versions out of date.
risk platform independency when writing code. Maybe I was a bit too
lazy to read about the boost specs as well, because I don't see what
part of boost I might be missing.
What exactly is so _valuable_ about boost?
By using boost libraries I'm able to focus on application features at a
higer level with less source code written/maintained by me. Some of the more
often used libraries in my applications include:
A simple example is the boost::filesystem library. I can now deal with
path's explicitly without cluttering the rest of my code with tokenizing and
verification code. I can then explicitly say that a data member is a path,
rather than a just generalized string. We can also replace/avoid the spawing
..bat files(resplendant with goto's) with simpler code for doing file
manipulations.
boost bind/function/lambda all make the STL algorithms that take predicates
or function objects worth using. seeing std::transform, std::find is self
explanatory when reading code (from others and increasingly from myself from
years earlier) then just seeing for loops. Additionally, I was able to use
boost bind/function to wrap non-thread-safe legacy C dll's with a task
queueing system within a few days. This eliminated numerous difficult to
reproduce bugs that our customers were seeing in the field with out GUI.
The boost crc library allows me to efficeintly determine if a document
changed indicator needs to be displayed in a graphical user interface, or to
prompt the user if they need to save a document before closing it.
dynamic_bitset simplifies bit flag manipulation for flags whose lengths vary
at runtime.
iterator library allows me to reuse both std algorithms and custom
algorithms with non stl containers. I've been able to succinctly/correctly
wrap many MS MFC conceptual containers, such as document views, filedialog
file selection lists, ... Use the same algorithm on a vectors or pointers or
objects, or maps by using transform and indirect iterators.
boost preprocessor libary simplified maintenance by replacing copied code
with macros that generate multiple function overloads with 1 to N arguments.
program_options helps to quickly create utility programs that handle
argument validation and dispatch.
regex supports regular expression processing for user input validation.
While there are other regex libraries, it's nice that the boost libraries
have a consistent feel. Once you use a few the others are even easier to
utilize.
serialization is used to save program state between closing and opening
applications, to supporting GUI cut/paste drag/drop operations.
signals - provides the publisher/subscriber framework at level of
granularity to support our app's multiple tree view interface.
smart_ptrs - see below
static_assert traps programming errors at compile time.
spirit - embed parsers within C++ source code. Replaces manual dissection of
strings with consistent parsing operations for large/small simple/complex
grammars.
string_algo has finally allowed me to drop use of proprietary string
classes. std::string did not easily support sub string replacement, ...
tokenizer - presents tokens with an iterator interface that allowed use with
standard algorithms.
utility/noncopyable simultaneously documents and disables copy/assignment
for classes where such operations are not desired.
....
What for would I need auto_ptr or things like that?
boost shared_ptr, scoped_ptr, weak_ptr, have all significantly increased the
reliablity of our products since they were used to replace much of the
manual memory management that previously caused problems.
Jeff Flinn