[63] The fact that char_traits<>::compare( ) may call strcmp( ) in one instance vs. wcscmp( ) in another, for example, is immaterial to the point we make here: the function performed by compare( ) is the same.
[64]
[65]
[66] Floating-point values are not compile-time constants, and therefore cannot be used in compile-time arithmetic.
[67] In 1966 Böhm and Jacopini proved that any language supporting selection and repetition, along with the ability to use an arbitrary number of variables, is equivalent to a Turing machine, which can implement any algorithm.
[68] Czarnecki and Eisenecker,
[69] There is a much better to compute powers of integers, of course (viz., the Russian Peasant Algorithm), but that is beside the point here.
[70]
[71] You actually are not allowed to pass object types (other than built-ins) to an ellipsis parameter specification, but since we are only asking for its size (a compile-time operation), the expression is never actually evaluated at runtime.
[72] A reprint of Todd’s original article can be found in Lippman,
[73] See his and Nico’s book,
[74] Namely, Blitz++ (http://www.oonumerics.org/blitz/), the Matrix Template Library (http://www.osl.iu.edu/research/mtl/), and POOMA (http://www.acl.lanl.gov/pooma/).
[75] We mean "vector" in the mathematical sense, as a fixed-length, one-dimensional, numerical array.
[76] Langer and Kreft, "C++ Expression Templates",
[77] As explained earlier, you must explicitly instantiate a template only once per program.
[78] Visit http://www.bdsoft.com/tools/stlfilt.html.
[79] Or something that is callable as a function, as you’ll see shortly.
[80] This is simply an English rendition of O(n log n), which is the mathematical way of saying that for large n, the number of comparisons grows in direct proportion to the function f(n) = n log n.
[81] Unless you do something ungainly like use global variables.
[82] Function objects are also called
[83] All standard iterators define a number of nested types, including value_type, which represents the type the iterator refers to. See Chapter 7 for more detail.
[84] If a compiler were to define string::empty with default arguments (which is allowed), then the expression &string::empty would define a pointer to a member function taking the total number of arguments. Since there is no way for the compiler to provide the extra defaults, there would be a "missing argument" error when an algorithm applied string::empty via mem_fun_ref.
[85] STLPort, for instance, which comes with version 6 of Borland C++ Builder and is based on SGI STL.
[86] The stable_sort( ) algorithm uses
[87] Iterators are discussed in more depth in the next chapter.
[88] Algorithms can determine the type of an iterator by reading its tag, discussed in the next chapter.
[89] We’re ignoring the copy constructor and assignment operator in this example, since they don’t apply.
[90] Without violating any copyright laws, of course.
[91] Visit http://www.dinkumware.com, http://www.sgi.com/tech/stl, or http://www.stlport.org.
[92] The container adaptors, stack, queue, and priority_queue do not support iterators, since they do not behave as sequences from the user’s point of view.
[93] It will only work for implementations of vector that uses a
[94] These were actually created to abstract the "locale" facets away from iostreams, so that locale facets could operate on any sequence of characters, not only iostreams. Locales allow iostreams to easily handle culturally-different formatting (such as the representation of money) and are beyond the scope of this book.
[95] You will need to provide a char_traits specialization for any other argument type.
[96] We are indebted to Nathan Myers for explaining this.