Sunday, April 15, 2012

Fresh typos


Section 6.4.2

There's a missing &:
vtable_impl<T>::destroy

should be:

&vtable_impl<T>::destroy



The code for rebuild says:

const vtable* oldvt = vt;
vt = vtable_singleton<void>::get(); 
(oldvt->destroy)(storage_);
(vt->construct)(storage_, src);
vt = newvt;

But it should be:

const vtable* oldvt = vt;
vt = vtable_singleton<void>::get(); 
(oldvt->destroy)(storage_);
(newvt->construct)(storage_, src);
vt = newvt;

The pointer has been replaced by a dummy for exception safety, so obviously vt will do nothing. 
Note that you should not swap lines #4 and #5

Section 6.3.5

There's a pointer to a type called fptbl_t, which does not exist.
It's actually called virtual_function_table (fptbl stands Function Pointer TaBLe)

There's an incorrect function call, spelled table.del(p). But table is a pointer, so it should read: (table->del)(p)

Section 6.3.6

The function safe_cast, has an argument called p but the code calls it src.

Section 5.2.1

The class string_traits contains typedefs argument_type and char_type, but for compactness, they are later referred to as arg_t and char_t.

Sunday, April 1, 2012

Typos that survived in the second revision



I'm showing the section numbers, instead of pages, because they are valid in both revisions.
  1. In section 4.6.7 about template rotation, there's some confusion between a template parameter called Dn and D9: the intent is that D9 is the last in the series, so it should be called Dn and D8 is thus Dn-1.
  2. In section 4.6.6 there's a spurious comma: template <P1, P2, = default...> should read template <P1, P2 = default...> 
  3. In section 4.3.1 [[CONDITION]] is mis-spelled as [[CONDITION]