21.12. Wrap-Up
In this chapter we discussed various
aspects of the future of C++. We introduced the Boost C++ Libraries and
described the Boost libraries that are included in TR1—the additions to the C++
Standard Library.
We discussed the Boost.Regex library and the symbols that are used to form regular
expressions. We provided examples of how to use Boost.Regex classes,
including regex, match_results and regex_token_iterator. You learned how to find patterns in a string and match
entire strings to patterns with Boost.Regex algorithms
regex_search and regex_match. We
demonstrated how to replace characters in a string with regex_replace and how to split strings into tokens with a
regex_token_iterator.
We gave examples of how to use the Boost.Smart_ptr
library. We discussed the smart pointers included in TR1, namely
shared_ptr and weak_ptr. We showed
you how to use these classes to avoid memory leaks when using dynamically
allocated memory. We demonstrated how to use custom deleter functions to allow
shared_ptrs to manage resources that require
special destruction procedures. We also explained how weak_ptrs can be used to prevent memory leaks in circularly
referential data.
We overviewed the upcoming revised
standard, C++0x, discussing TR1 and the changes to the core language. We
introduced each of the libraries accepted into TR1. We described the new core
language features including the auto keyword, rvalue reference,
improvements in compatibility with C99, additional integer types and the new
concept of conditionally supported behavior. Remember that Boost, TR1 and C++0x
are constantly changing—visit our Resource Centers to stay up to date with all
three.
In the next chapter, we discuss
several more advanced C++ features, including cast operators, namespaces,
operator keywords, pointer-to-class-member operators, multiple inheritance and
virtual base classes.