Commit 1af5d90
committed
vector_base: use new_storage to construct and destroy
Inside of append(), for the case that the underlying storage
had to be reallocated to accomodate its new capacity, the
code is currently using the old storage (ie., `m_storage`) to do
the default construction, and possibly destruction when needing
to clean up after an exception.
It is more consistent to use the `new_storage` member functions to
do so -- after all we are constructing (or destroying) elements in
that `new_storage` here.
This is essentially a cleanup only, it doesn't actually change behavior,
since `new_storage` is created to use a copy of the allocator that's in
`m_storage`, so the `default_construct_n` and `destroy` functions called
are identical in practice -- it just makes this piece of code more consistent.1 parent 0f2f85c commit 1af5d90
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
880 | | - | |
| 880 | + | |
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
886 | | - | |
| 886 | + | |
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
| |||
0 commit comments