About the Examples
In crafting our code examples, we strove for simplicity, portability, and performance.
The design for each solution followed a similar path: use standard C++ (language or library)
if possible; if not, use a de facto standard as the replacement. For example, many of the
recipes that deal with strings use the standard string
class, and most of the mathematical and scientific recipes use standard numeric types,
containers, and templates. The standard library has strong support for these areas, so
standard facilities are a perfect fit. By comparison, however, C++ has little or no
standardized support for multithreading or XML parsing. Thus, we used the multithreading
support provided in the Boost Threads library and the XML parsing functionality provided by
the Xerces parser.
Often, there are many ways to do the same thing in C++, which gives developers flexibility, but also invites some controversy. Most of the examples illustrate the best general solution we could come up with, but that doesn’t mean that it’s the best solution ever. If there are alternative solutions that are better in some ways and not as good in others (maybe the solution that uses the standard library is awkward or unintuitive; in this case, we may provide an alternative that uses Boost), we present the alternative anyway to give you some insight into the various solutions that are available.
Lots of the examples use templates. If you don’t have much experience writing templates, you should get ...