Errata

C++ In a Nutshell

Errata for C++ In a Nutshell

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
2.6
2.6 Object Declarations

int*&* pr = p;
should be
int*& pr = p;

Anonymous  Apr 20, 2009 
Printed Page 4
list of keywords at the top

"reintepret_cast"
should be
"reinterpret_cast"

ssfire  Jun 29, 2010 
Printed Page 26
3rd paragraph

"but without a name you cannot declare use the enumeration in other declarations"
should be:
"but without a name you cannot use the enumeration in other declarations"

ssfire  Jun 29, 2010 
Printed Page 35
References

You say that the following is a reference to a pointer:

int*&* pr = p;

but in fact, this is a reference to a pointer:

int *& pr = p;

Flapz  Sep 17, 2010 
Printed Page 130
In section "The main Function", 2nd paragraph, 2nd sentence

The sentence: "By definition, argv[argc] is a null pointer."
should be: "By definition, argv[argc] is not a null pointer.".

Vaughn Spurlin  Sep 28, 2010 
Printed Page 145
code example

"context*"
should be
"graphics* context"

ssfire  Jun 29, 2010 
Printed Page 157
example code

"Calls dynamic::func()"
should be
"Calls derived::func()"

ssfire  Jun 29, 2010 
Printed Page 169
middle of the code example

"// public inheritance menas x is public and y is protected"
should be:
"// public inheritance means x is public and y is protected"

ssfire  Jun 29, 2010 
Printed Page 196
Top of page; "wrapper w" should be "wrapper<> w"

Anonymous   
PDF Page 216 in section titled "Wide characters"
Below fourth paragraph

The example wchar_t wpi[] = "\u03c0"; is incorrect because it does not uses the prefix `L`. So to correct this, the prefix `L` should be added as shown below:

```
wchar_t wpi[] = L"\u03c0"; //note the prefix L used here which was not there before
```

Anoop Rana  Sep 26, 2022 
Printed Page 257
forward Iterator implemention in erase

Suppose multiple iterator variables point to the node after the one being deleted. The the prev_ pointers become invalid pointers once the delete happens: nothing goes through the iterators fixing them. Thus they are invalidated. But sequence containers should only invalidate iterators pointing to the node being deleted and no others.

This mixes with the definition of iterator on page 264.

More normal would be to point back to the slist itself and to traverse to find the "prev" needed. more expensive the further down the list it goes but such leads to the correct set sof invalidated iterators.

Anonymous  Nov 02, 2008 
Printed Page 257
forward Iterator implemention in erase

I previously described how deleting Node N of a node based container is not supposed to invalidate the iterators pointing to node N+1 but that the slist example does. But I said "sequence container" where I should have said "node-based container". Sorry.

Anonymous  Nov 02, 2008 
Printed Page 264
Iterator definition

The slist::link_type* prev_ pointer usage can invalidate one or more iterators when erase deletes the node pointer to. Sequence containers are not supposed to invalidate any iterators referring the item following the erased one.

Anonymous  Nov 02, 2008 
Printed, PDF Page 337
for_each function template signature

The return type of for_each should be Func, not Function, to match the template parameter.

bkell  Sep 22, 2013 
Printed, PDF Page 341
iter_swap code sample

The first line of the code describing the functionality of the iter_swap function has two typos. The type name "FdwIter1" should be "FwdIter1", and the expression "*b*" should be just "*b".

bkell  Sep 21, 2013 
Printed Page 448
Table 13-6

The conversion specifier for day of the month is listed as 'D'. It should be 'd'.

Anonymous  Mar 08, 2010 
PDF Page 720
<vector>

The last sentence of the description reads:

"See Chapter 10 for information about containers in."

Containers in what?

Chris Wilson  Sep 14, 2014