top

errata for Imperfect C++ by Matthew Wilson

(1st printing)

The errata below I sent to Matthew and he intends to add them to his site as he finds the time :) Other errata you can find at his errata page.

where erratum correct
page 47 int *&device = dc.m_device; int& device = dc.m_device;
page 213 template <typename T, int N>
char (&byte_array_of_same_dimension_as(T (&)[N]))[N];
#define dimensionof(x) sizeof(byte_array_of_same_dimension_as((x)));
#define dimensionof(x) sizeof(byte_array_of_same_dimension_as((x)))
page 381 cite: the technique of combining static_cast and CRTP. original idea of Barton-Nackman, not Coplien. (see also: Barton-Nackman-trick confusion)
page 486,
table 32.4
erase(&back()) just wrong
page 542 WeekDay get_DayOfWeek() const
{
 return WeekDay.m_value;
}
WeekDay get_DayOfWeek() const
{
 return DayOfWeek.m_value;
}
page 546, 552 &C::P##_offset &C::P##_offset##C
page 548 &C::P##_offset##C () &C::P##_offset##C