AW - Essential C++ Errata
AW - Essential C++ Errata
The following is a listing by chapter of the Essential C++ errata that I am aware of. If you come across
any corrections that are not listed, please drop me a line at [email protected]. Thanks! stan
0.1 Preface
Page ix:
to read the raw Disney camera information for a scene and generate a camera node that could be plugged into [
not in to ] the Houdini animation package. I wrote it in C++, of course. It worked.
Page 19, there is a superfluous I preceding After in the 3rd paragraph of the page:
IAfter [ read: After ] a case label is matched, all the case labels following the matched case label are also
executed unless we explicitly break off execution. This is what the break statement does. Why, youre probably
asking, is the switch statement designed this way? Here is an example of this fall-through behavior being just
right:
Page 20, the code-fragement while-loop, hear the bottom of the page:
cout << "Want to try another sequence? (Y/N) "
char try_again;
cin >> try-again; [ read: try_again; ]
should read:
if ( !ix ){
_elems.push_back( 1 );
ix = 1;
}
if ( ix == _max_elems )
cerr << "Triangular Sequence: oops: value too large "
<< value << " -- exceeds max size of "
<< _max_elems << endl;
Page 121, the check_integrity() function is off by one -- note that the two versions on
page 124 illustrating friendship also need to be revised -- note: this also occurs on pages 191-192
of Chapter 7 when we look at the throw clause
// was: if ( mat.waiting_list();
if ( mat.waiting_list() )
mat.notify_available();
}
IThe [ read: The ] derived class consists of two parts: the subobject of its base class (consisting of the nonstatic
base class data members, if any) and the derived class portion (consist
Page 151, code is incorrect -- note, this is repeated in the template implementation of p. 184:
// incorrect: if ( _elems.size() < pos )
if ( _elems.size() <= pos )
{
int ix = _elems.size();
int n_2 = _elems[ ix-2 ];
int n_1 = _elems[ ix-1 ];
return true;
}
instances of both the Fibonacci derived class and the num_sequence base class are generated with len bound to
16. Alternatively, we might parametermize [ read: parameterize ] both the
Page 247: declaration of template friend function reflects the syntax of classic C++ -- supported
by Visual C++ 6.0 and the 7.3 SGI C++ compiler. The Standard C++ syntax looks as follows:
template <typename elemType> class Matrix;