Conclusion
I've skipped over some of the details of most of these changes. I don't plan on addressing these changes systematicallyyou'll undoubtedly be seeing books about the new language Standard as it becomes more complete and more stable. In the meantime, I'll continue to highlight the changes as they're approved, which will be once every six months.
Notes
- The nearly final draft is available at www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf. The special math functions, including such things as elliptic integrals of the first kind and hermite polynomials, were felt to be too complex and too narrowly focused for the Standard.
- A call wrapper is one form of what is known generically as a "function object." A call wrapper type has a function call operator that forwards to a function object held by the call wrapper. One example of a call wrapper is the object returned by std::mem_fun: It holds a pointer to member function. It has a function call operator that can be called with ordinary function call syntax, and forwards to the pointer to member function, treating its first argument as the object to apply the pointer to.
- Of course, to use these new library facilities you'll need a good reference book. My completely unbiased recommendation is my book, The C++ Standard Library Extensions: A Tutorial and Reference, which will be published this summer by Addison-Wesley.
- This example is attributed to Hyman Rosen in the paper that first proposed changing this rule.
- This example puts the default constructor in the initializer list, but you can use any valid constructor invocation. When you do this, you can't put anything else in the initializer list. You have to do all of the relevant initialization in the target constructor, and then the body of the constructor you're defining can do whatever else needs to be done.
- Unfortunately, this change will be interpreted as an endorsement of writing one-off loops instead of algorithms. In general, instead of creating named iterator objects, you should write template functions and call them with the temporary objects returned by begin() and end().
- Or eight, depending on whether you count the version that uses "<" as separate from the version that uses a user-supplied predicate.
- Epsilon is the smallest value that can be added to 1.0 to produce a different value.
- You can also have ordinary macro arguments before the ellipsis.