Errata

The Rules of Programming

Errata for The Rules of Programming

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
PDF Page Page 49
2nd code example

if (sign->color() == color &&
getDistance(sign->location(), location) >= distance)

This code should be

if (sign->color() == color &&
getDistance(sign->location(), location) <= distance)

following the previous code (findSignNearLocation())

Ryuichi Kubuki  Sep 24, 2023 
PDF Page 256
2nd code block

As code, when g_useNewStackAlloc is set, size of "old" array' is returned.
The name of flag is not matched with its usage. I guess NOT operator (!) is missing like below:

template <class ELEMENT>
size_t StackVector<ELEMENT>::size() const
{
if (!g_useNewStackAlloc)
return m_oldArray.size();
else
return m_newArray.size();
}

Bruce Yoon  Apr 22, 2024 
PDF Page 258
1st paragraph

"then isExplicitContext won’t
be set, and reserve will run exactly as before." should be
"then m_isExplicitContext won’t
be set, and reserve will run exactly as before."

In the code, there is no variable which name is "isExplicitContext".




Bruce Yoon  Apr 22, 2024