11// SPDX-License-Identifier: BSD-3-Clause
2- /* Copyright 2018-2020 , Intel Corporation */
2+ /* Copyright 2018-2021 , Intel Corporation */
33
44/* *
55 * @file
@@ -644,7 +644,7 @@ vector<T>::assign(size_type count, const_reference value)
644644 add_data_to_tx (0 , size_old);
645645
646646 std::fill_n (
647- & _data[ 0 ] ,
647+ _data. get () ,
648648 (std::min)(count,
649649 static_cast <size_type>(size_old)),
650650 value);
@@ -1578,7 +1578,7 @@ vector<T>::insert(const_iterator pos, size_type count, const value_type &value)
15781578 single_element_iterator<value_type>(&value, count));
15791579 });
15801580
1581- return iterator (& _data[ static_cast <difference_type>(idx)] );
1581+ return iterator (_data. get () + static_cast <difference_type>(idx));
15821582}
15831583
15841584/* *
@@ -1821,7 +1821,7 @@ typename vector<T>::iterator
18211821vector<T>::erase(const_iterator first, const_iterator last)
18221822{
18231823 size_type idx = static_cast <size_type>(
1824- std::distance (const_iterator (& _data[ 0 ] ), first));
1824+ std::distance (const_iterator (_data. get () ), first));
18251825 size_type count = static_cast <size_type>(std::distance (first, last));
18261826
18271827 if (count == 0 )
@@ -2293,10 +2293,11 @@ vector<T>::internal_insert(size_type idx, InputIt first, InputIt last)
22932293 auto count = static_cast <size_type>(std::distance (first, last));
22942294
22952295 if (_capacity >= size () + count) {
2296- pointer dest =
2297- &_data[static_cast <difference_type>(size () + count)];
2298- pointer begin = &_data[static_cast <difference_type>(idx)];
2299- pointer end = &_data[static_cast <difference_type>(size ())];
2296+ pointer dest = _data.get () +
2297+ static_cast <difference_type>(size () + count);
2298+ pointer begin = _data.get () + static_cast <difference_type>(idx);
2299+ pointer end =
2300+ _data.get () + static_cast <difference_type>(size ());
23002301
23012302 add_data_to_tx (idx, size () - idx + count);
23022303
@@ -2314,9 +2315,11 @@ vector<T>::internal_insert(size_type idx, InputIt first, InputIt last)
23142315
23152316 auto old_data = _data;
23162317 auto old_size = _size;
2317- pointer old_begin = &_data[0 ];
2318- pointer old_mid = &_data[static_cast <difference_type>(idx)];
2319- pointer old_end = &_data[static_cast <difference_type>(size ())];
2318+ pointer old_begin = _data.get ();
2319+ pointer old_mid =
2320+ _data.get () + static_cast <difference_type>(idx);
2321+ pointer old_end =
2322+ _data.get () + static_cast <difference_type>(size ());
23202323
23212324 _data = nullptr ;
23222325 _size = _capacity = 0 ;
@@ -2384,7 +2387,7 @@ vector<T>::realloc(size_type capacity_new)
23842387
23852388 auto old_data = _data;
23862389 auto old_size = _size;
2387- pointer old_begin = & _data[ 0 ] ;
2390+ pointer old_begin = _data. get () ;
23882391 pointer old_end = capacity_new < _size
23892392 ? &_data[static_cast <difference_type>(capacity_new)]
23902393 : &_data[static_cast <difference_type>(size ())];
0 commit comments