C.61: Fixed example to use new[] instead to allocate an array.

This commit is contained in:
Michael Park 2015-12-21 13:01:19 -05:00
parent 26fc14cc8a
commit d78a1b81a0

View File

@ -4603,7 +4603,7 @@ After a copy `x` and `y` can be independent objects (value semantics, the way no
} }
X::X(const X& a) X::X(const X& a)
:p{new T}, sz{a.sz} :p{new T[a.sz]}, sz{a.sz}
{ {
copy(a.p, a.p + sz, a.p); copy(a.p, a.p + sz, a.p);
} }