containers doc brush

This commit is contained in:
2022-04-21 22:58:24 +03:00
parent 9deae168a6
commit c476a06e8c
2 changed files with 39 additions and 37 deletions

View File

@@ -1193,7 +1193,7 @@ public:
//! \~\code //! \~\code
//! PIDeque<int> v{2, 5, 9, 2}; //! PIDeque<int> v{2, 5, 9, 2};
//! int a[2] = {12, 13}; //! int a[2] = {12, 13};
//! memcpy(vec.data(1), carr, 2 * sizeof(int)); //! memcpy(vec.data(1), a, 2 * sizeof(int));
//! piCout << v; // {2, 12, 13, 2} //! piCout << v; // {2, 12, 13, 2}
//! \endcode //! \endcode
inline T * data(size_t index = 0) { inline T * data(size_t index = 0) {
@@ -1238,7 +1238,7 @@ public:
//! \~russian //! \~russian
//! Индекс начала должен лежать в диапазоне от `0` до `size()-1`. //! Индекс начала должен лежать в диапазоне от `0` до `size()-1`.
//! Если заданный размер подмассива превышает размер текущего массива, //! Если заданный размер подмассива превышает размер текущего массива,
//! то вернется подмассив меншего размера (`size()-index-1`). //! то вернется подмассив меньшего размера (`size()-index-1`).
PIDeque<T> getRange(size_t index, size_t count) const { PIDeque<T> getRange(size_t index, size_t count) const {
if (index >= pid_size || count == 0) return PIDeque<T>(); if (index >= pid_size || count == 0) return PIDeque<T>();
if (index + count > pid_size) count = pid_size - index; if (index + count > pid_size) count = pid_size - index;
@@ -1249,8 +1249,9 @@ public:
//! \~english Clear array, remove all elements. //! \~english Clear array, remove all elements.
//! \~russian Очищает массив, удаляет все элементы. //! \~russian Очищает массив, удаляет все элементы.
//! \~\details //! \~\details
//! \~english Note: reserved memory will not be released. //! \~\note
//! \~russian Замечание: зарезервированная память не освободится. //! \~english Reserved memory will not be released.
//! \~russian Зарезервированная память не освободится.
//! \~\sa \a resize() //! \~\sa \a resize()
template<typename T1 = T, typename std::enable_if< template<typename T1 = T, typename std::enable_if<
!std::is_trivially_copyable<T1>::value !std::is_trivially_copyable<T1>::value
@@ -1317,7 +1318,7 @@ public:
//! \~\brief //! \~\brief
//! \~english First does `resize(new_size)` then `fill(e)`. //! \~english First does `resize(new_size)` then `fill(e)`.
//! \~russian Сначала делает `resize(new_size)` затем `fill(e)`. //! \~russian Сначала делает `resize(new_size)`, затем `fill(e)`.
//! \~\sa \a fill(), \a resize() //! \~\sa \a fill(), \a resize()
template<typename T1 = T, typename std::enable_if< template<typename T1 = T, typename std::enable_if<
!std::is_trivially_copyable<T1>::value !std::is_trivially_copyable<T1>::value
@@ -1559,7 +1560,7 @@ public:
//! \~\brief //! \~\brief
//! \~english Removes `count` elements from the middle of the array, starting at `index` position. //! \~english Removes `count` elements from the middle of the array, starting at `index` position.
//! \~russian Удаляет элементы из массива, начиная с позиции `index`, в количестве `count`. //! \~russian Удаляет элементы из массива, начиная с позиции `index` в количестве `count`.
//! \~\details //! \~\details
//! \code //! \code
//! PIDeque<int> v{1, 3, 7, 5}; //! PIDeque<int> v{1, 3, 7, 5};
@@ -1711,8 +1712,8 @@ public:
//! \~english If `add_size > 0` then elements are added to the end of the array. //! \~english If `add_size > 0` then elements are added to the end of the array.
//! If `add_size < 0` then elements are removed from the end of the array. //! If `add_size < 0` then elements are removed from the end of the array.
//! If `add_size < 0` and there are fewer elements in the array than specified, then the array becomes empty. //! If `add_size < 0` and there are fewer elements in the array than specified, then the array becomes empty.
//! \~russian Если `add_size > 0` то в конец массива добавляются элементы. //! \~russian Если `add_size > 0`, то в конец массива добавляются элементы.
//! Если `add_size < 0` то с конца массива удаляются элементы. //! Если `add_size < 0`, то с конца массива удаляются элементы.
//! Если `add_size < 0` и в массиве меньше элементов чем указано, то массив становится пустым. //! Если `add_size < 0` и в массиве меньше элементов чем указано, то массив становится пустым.
//! \~\sa \a resize() //! \~\sa \a resize()
inline PIDeque<T> & enlarge(llong pid_size) { inline PIDeque<T> & enlarge(llong pid_size) {
@@ -1795,12 +1796,12 @@ public:
//! then all iterators and references //! then all iterators and references
//! (including the past-the-end iterator) are invalidated. //! (including the past-the-end iterator) are invalidated.
//! Otherwise only the past-the-end iterator is invalidated. //! Otherwise only the past-the-end iterator is invalidated.
//! \~russian Если size() меньше capacity(), что чаше всего, //! \~russian Если size() меньше capacity(), что часто бывает,
//! то добавление будет очень быстрым. //! то добавление будет очень быстрым.
//! В любом случае добавление быстрое и не зависит от размера массива. //! В любом случае добавление быстрое и не зависит от размера массива.
//! Если новый size() больше, чем capacity(), //! Если новый size() больше, чем capacity(),
//! то все итераторы и указатели становятся нерабочими. //! то все итераторы и указатели становятся нерабочими.
//! В противном случае, все, кроме итераторов указывающих на конец массива, //! В противном случае все, кроме итераторов, указывающих на конец массива,
//! остаются в рабочем состоянии. //! остаются в рабочем состоянии.
//! \~\code //! \~\code
//! PIDeque<int> v{1, 2, 3}; //! PIDeque<int> v{1, 2, 3};
@@ -1879,12 +1880,12 @@ public:
//! then all iterators and references //! then all iterators and references
//! (including the past-the-end iterator) are invalidated. //! (including the past-the-end iterator) are invalidated.
//! Otherwise only the past-the-end iterator is invalidated. //! Otherwise only the past-the-end iterator is invalidated.
//! \~russian Если size() меньше capacity(), что чаше всего, //! \~russian Если size() меньше capacity(), что часто бывает,
//! то добавление будет очень быстрым. //! то добавление будет очень быстрым.
//! В любом случае добавление быстрое и не зависит от размера массива. //! В любом случае добавление быстрое и не зависит от размера массива.
//! Если новый size() больше, чем capacity(), //! Если новый size() больше, чем capacity(),
//! то все итераторы и указатели становятся нерабочими. //! то все итераторы и указатели становятся нерабочими.
//! В противном случае, все, кроме итераторов указывающих на конец массива, //! В противном случае все, кроме итераторов, указывающих на конец массива,
//! остаются в рабочем состоянии. //! остаются в рабочем состоянии.
//! \~\code //! \~\code
//! PIDeque<int> v{1, 2, 3}; //! PIDeque<int> v{1, 2, 3};
@@ -1993,11 +1994,11 @@ public:
//! (including the past-the-begin iterator) are invalidated. //! (including the past-the-begin iterator) are invalidated.
//! Otherwise only the past-the-begin iterator is invalidated. //! Otherwise only the past-the-begin iterator is invalidated.
//! \~russian Если в начале массива имеется свободное место, //! \~russian Если в начале массива имеется свободное место,
//! что чаше всего, то добавление будет очень быстрым. //! что часто бывает, то добавление будет очень быстрым.
//! В любом случае добавление быстрое и не зависит от размера массива. //! В любом случае добавление быстрое и не зависит от размера массива.
//! Если в начале массива нет свободного места, //! Если в начале массива нет свободного места,
//! то все итераторы и указатели становятся нерабочими. //! то все итераторы и указатели становятся нерабочими.
//! В противном случае, все, кроме итераторов указывающих на начало массива, //! В противном случае все, кроме итераторов указывающих, на начало массива,
//! остаются в рабочем состоянии. //! остаются в рабочем состоянии.
//! \~\code //! \~\code
//! PIDeque<int> v{1, 2, 3}; //! PIDeque<int> v{1, 2, 3};
@@ -2068,11 +2069,11 @@ public:
//! (including the past-the-begin iterator) are invalidated. //! (including the past-the-begin iterator) are invalidated.
//! Otherwise only the past-the-begin iterator is invalidated. //! Otherwise only the past-the-begin iterator is invalidated.
//! \~russian Если в начале массива имеется свободное место, //! \~russian Если в начале массива имеется свободное место,
//! что чаше всего, то добавление будет очень быстрым. //! что часто бывает, то добавление будет очень быстрым.
//! В любом случае добавление быстрое и не зависит от размера массива. //! В любом случае добавление быстрое и не зависит от размера массива.
//! Если в начале массива нет свободного места, //! Если в начале массива нет свободного места,
//! то все итераторы и указатели становятся нерабочими. //! то все итераторы и указатели становятся нерабочими.
//! В противном случае, все, кроме итераторов указывающих на начало массива, //! В противном случае все, кроме итераторов указывающих, на начало массива,
//! остаются в рабочем состоянии. //! остаются в рабочем состоянии.
//! \~\code //! \~\code
//! PIDeque<int> v{1, 2, 3}; //! PIDeque<int> v{1, 2, 3};
@@ -2154,7 +2155,7 @@ public:
//! \~english Removing an element from the beginning takes longer than from the end. //! \~english Removing an element from the beginning takes longer than from the end.
//! This time is directly proportional to the size of the array. //! This time is directly proportional to the size of the array.
//! All iterators and references are invalidated. //! All iterators and references are invalidated.
//! \~russian Удаление элемента с начала выполняется дольше чем с конца. //! \~russian Удаление элемента с начала выполняется дольше, чем с конца.
//! Это время прямопропорционально размеру массива. //! Это время прямопропорционально размеру массива.
//! При удалении элемента все итераторы и указатели становятся нерабочими. //! При удалении элемента все итераторы и указатели становятся нерабочими.
//! \~\code //! \~\code
@@ -2292,7 +2293,7 @@ public:
//! once for each element in an array, in order, //! once for each element in an array, in order,
//! and constructs a new array from the results. //! and constructs a new array from the results.
//! \~russian Метод `map` вызывает переданную функцию `ST f(const T & e)` //! \~russian Метод `map` вызывает переданную функцию `ST f(const T & e)`
//! один раз для каждого элемента, в порядке их появления //! один раз для каждого элемента в порядке их появления
//! и конструирует новый массив из результатов её вызова. //! и конструирует новый массив из результатов её вызова.
//! \~\code //! \~\code
//! PIDeque<int> v{1, 2, 3}; //! PIDeque<int> v{1, 2, 3};
@@ -2411,7 +2412,7 @@ public:
//! \~russian Изменяет размерность массива, из двухмерный массива создает одномерный. //! \~russian Изменяет размерность массива, из двухмерный массива создает одномерный.
//! \~\details //! \~\details
//! \~russian Делает массив плоским. //! \~russian Делает массив плоским.
//! Порядок обхода исходного массива, задаётся с помощью \a ReshapeOrder. //! Порядок обхода исходного массива задаётся с помощью \a ReshapeOrder.
//! \~english Makes the array flat. //! \~english Makes the array flat.
//! Еhe order of traversing the source array is set using \a ReshapeOrder. //! Еhe order of traversing the source array is set using \a ReshapeOrder.
//! \~\code //! \~\code

View File

@@ -623,7 +623,7 @@ public:
//! \~\details ![begin, end](doc/images/pivector_begin.png) //! \~\details ![begin, end](doc/images/pivector_begin.png)
//! //!
//! \~english If the array is empty, the returned iterator is equal to \a end(). //! \~english If the array is empty, the returned iterator is equal to \a end().
//! \~russian Если массив - пуст, возвращаемый итератор будет равен \a end(). //! \~russian Если массив пустой, возвращаемый итератор будет равен \a end().
//! \~\return \ref stl_iterators //! \~\return \ref stl_iterators
//! \~\sa \a end(), \a rbegin(), \a rend() //! \~\sa \a end(), \a rbegin(), \a rend()
inline iterator begin() { inline iterator begin() {
@@ -1180,7 +1180,7 @@ public:
//! \~\code //! \~\code
//! PIVector<int> v{2, 5, 9, 2}; //! PIVector<int> v{2, 5, 9, 2};
//! int a[2] = {12, 13}; //! int a[2] = {12, 13};
//! memcpy(vec.data(1), carr, 2 * sizeof(int)); //! memcpy(vec.data(1), a, 2 * sizeof(int));
//! piCout << v; // {2, 12, 13, 2} //! piCout << v; // {2, 12, 13, 2}
//! \endcode //! \endcode
inline T * data(size_t index = 0) { inline T * data(size_t index = 0) {
@@ -1225,7 +1225,7 @@ public:
//! \~russian //! \~russian
//! Индекс начала должен лежать в диапазоне от `0` до `size()-1`. //! Индекс начала должен лежать в диапазоне от `0` до `size()-1`.
//! Если заданный размер подмассива превышает размер текущего массива, //! Если заданный размер подмассива превышает размер текущего массива,
//! то вернется подмассив меншего размера (`size()-index-1`). //! то вернется подмассив меньшего размера (`size()-index-1`).
PIVector<T> getRange(size_t index, size_t count) const { PIVector<T> getRange(size_t index, size_t count) const {
if (index >= piv_size || count == 0) return PIVector<T>(); if (index >= piv_size || count == 0) return PIVector<T>();
if (index + count > piv_size) count = piv_size - index; if (index + count > piv_size) count = piv_size - index;
@@ -1236,8 +1236,9 @@ public:
//! \~english Clear array, remove all elements. //! \~english Clear array, remove all elements.
//! \~russian Очищает массив, удаляет все элементы. //! \~russian Очищает массив, удаляет все элементы.
//! \~\details //! \~\details
//! \~english Note: reserved memory will not be released. //! \~\note
//! \~russian Замечание: зарезервированная память не освободится. //! \~english Reserved memory will not be released.
//! \~russian Зарезервированная память не освободится.
//! \~\sa \a resize() //! \~\sa \a resize()
template<typename T1 = T, typename std::enable_if< template<typename T1 = T, typename std::enable_if<
!std::is_trivially_copyable<T1>::value !std::is_trivially_copyable<T1>::value
@@ -1303,7 +1304,7 @@ public:
//! \~\brief //! \~\brief
//! \~english First does `resize(new_size)` then `fill(e)`. //! \~english First does `resize(new_size)` then `fill(e)`.
//! \~russian Сначала делает `resize(new_size)` затем `fill(e)`. //! \~russian Сначала делает `resize(new_size)`, затем `fill(e)`.
//! \~\sa \a fill(), \a resize() //! \~\sa \a fill(), \a resize()
template<typename T1 = T, typename std::enable_if< template<typename T1 = T, typename std::enable_if<
!std::is_trivially_copyable<T1>::value !std::is_trivially_copyable<T1>::value
@@ -1507,7 +1508,7 @@ public:
//! \~\brief //! \~\brief
//! \~english Removes `count` elements from the middle of the array, starting at `index` position. //! \~english Removes `count` elements from the middle of the array, starting at `index` position.
//! \~russian Удаляет элементы из массива, начиная с позиции `index`, в количестве `count`. //! \~russian Удаляет элементы из массива, начиная с позиции `index` в количестве `count`.
//! \~\details //! \~\details
//! \code //! \code
//! PIVector<int> v{1, 3, 7, 5}; //! PIVector<int> v{1, 3, 7, 5};
@@ -1648,8 +1649,8 @@ public:
//! \~english If `add_size > 0` then elements are added to the end of the array. //! \~english If `add_size > 0` then elements are added to the end of the array.
//! If `add_size < 0` then elements are removed from the end of the array. //! If `add_size < 0` then elements are removed from the end of the array.
//! If `add_size < 0` and there are fewer elements in the array than specified, then the array becomes empty. //! If `add_size < 0` and there are fewer elements in the array than specified, then the array becomes empty.
//! \~russian Если `add_size > 0` то в конец массива добавляются элементы. //! \~russian Если `add_size > 0`, то в конец массива добавляются элементы.
//! Если `add_size < 0` то с конца массива удаляются элементы. //! Если `add_size < 0`, то с конца массива удаляются элементы.
//! Если `add_size < 0` и в массиве меньше элементов чем указано, то массив становится пустым. //! Если `add_size < 0` и в массиве меньше элементов чем указано, то массив становится пустым.
//! \~\sa \a resize() //! \~\sa \a resize()
inline PIVector<T> & enlarge(llong add_size, const T & e = T()) { inline PIVector<T> & enlarge(llong add_size, const T & e = T()) {
@@ -1732,12 +1733,12 @@ public:
//! then all iterators and references //! then all iterators and references
//! (including the past-the-end iterator) are invalidated. //! (including the past-the-end iterator) are invalidated.
//! Otherwise only the past-the-end iterator is invalidated. //! Otherwise only the past-the-end iterator is invalidated.
//! \~russian Если size() меньше capacity(), что чаше всего, //! \~russian Если size() меньше capacity(), что часто бывает,
//! то добавление будет очень быстрым. //! то добавление будет очень быстрым.
//! В любом случае добавление быстрое и не зависит от размера массива. //! В любом случае добавление быстрое и не зависит от размера массива.
//! Если новый size() больше, чем capacity(), //! Если новый size() больше, чем capacity(),
//! то все итераторы и указатели становятся нерабочими. //! то все итераторы и указатели становятся нерабочими.
//! В противном случае, все, кроме итераторов указывающих на конец массива, //! В противном случае все, кроме итераторов, указывающих на конец массива,
//! остаются в рабочем состоянии. //! остаются в рабочем состоянии.
//! \~\code //! \~\code
//! PIVector<int> v{1, 2, 3}; //! PIVector<int> v{1, 2, 3};
@@ -1817,12 +1818,12 @@ public:
//! then all iterators and references //! then all iterators and references
//! (including the past-the-end iterator) are invalidated. //! (including the past-the-end iterator) are invalidated.
//! Otherwise only the past-the-end iterator is invalidated. //! Otherwise only the past-the-end iterator is invalidated.
//! \~russian Если size() меньше capacity(), что чаше всего, //! \~russian Если size() меньше capacity(), что часто бывает,
//! то добавление будет очень быстрым. //! то добавление будет очень быстрым.
//! В любом случае добавление быстрое и не зависит от размера массива. //! В любом случае добавление быстрое и не зависит от размера массива.
//! Если новый size() больше, чем capacity(), //! Если новый size() больше, чем capacity(),
//! то все итераторы и указатели становятся нерабочими. //! то все итераторы и указатели становятся нерабочими.
//! В противном случае, все, кроме итераторов указывающих на конец массива, //! В противном случае все, кроме итераторов, указывающих на конец массива,
//! остаются в рабочем состоянии. //! остаются в рабочем состоянии.
//! \~\code //! \~\code
//! PIVector<int> v{1, 2, 3}; //! PIVector<int> v{1, 2, 3};
@@ -1926,7 +1927,7 @@ public:
//! \~english Adding an element to the beginning takes longer than to the end. //! \~english Adding an element to the beginning takes longer than to the end.
//! This time is directly proportional to the size of the array. //! This time is directly proportional to the size of the array.
//! All iterators and references are invalidated. //! All iterators and references are invalidated.
//! \~russian Добавление элемента в начало выполняется дольше чем в конец. //! \~russian Добавление элемента в начало выполняется дольше, чем в конец.
//! Это время прямопропорционально размеру массива. //! Это время прямопропорционально размеру массива.
//! При добавлении элемента все итераторы и указатели становятся нерабочими. //! При добавлении элемента все итераторы и указатели становятся нерабочими.
//! \~\code //! \~\code
@@ -1993,7 +1994,7 @@ public:
//! \~english Adding an element to the beginning takes longer than to the end. //! \~english Adding an element to the beginning takes longer than to the end.
//! This time is directly proportional to the size of the array. //! This time is directly proportional to the size of the array.
//! All iterators and references are invalidated. //! All iterators and references are invalidated.
//! \~russian Добавление элемента в начало выполняется дольше чем в конец. //! \~russian Добавление элемента в начало выполняется дольше, чем в конец.
//! Это время прямопропорционально размеру массива. //! Это время прямопропорционально размеру массива.
//! При добавлении элемента все итераторы и указатели становятся нерабочими. //! При добавлении элемента все итераторы и указатели становятся нерабочими.
//! \~\code //! \~\code
@@ -2076,7 +2077,7 @@ public:
//! \~english Removing an element from the beginning takes longer than from the end. //! \~english Removing an element from the beginning takes longer than from the end.
//! This time is directly proportional to the size of the array. //! This time is directly proportional to the size of the array.
//! All iterators and references are invalidated. //! All iterators and references are invalidated.
//! \~russian Удаление элемента с начала выполняется дольше чем с конца. //! \~russian Удаление элемента с начала выполняется дольше, чем с конца.
//! Это время прямопропорционально размеру массива. //! Это время прямопропорционально размеру массива.
//! При удалении элемента все итераторы и указатели становятся нерабочими. //! При удалении элемента все итераторы и указатели становятся нерабочими.
//! \~\code //! \~\code
@@ -2214,7 +2215,7 @@ public:
//! once for each element in an array, in order, //! once for each element in an array, in order,
//! and constructs a new array from the results. //! and constructs a new array from the results.
//! \~russian Метод `map` вызывает переданную функцию `ST f(const T & e)` //! \~russian Метод `map` вызывает переданную функцию `ST f(const T & e)`
//! один раз для каждого элемента, в порядке их появления //! один раз для каждого элемента в порядке их появления
//! и конструирует новый массив из результатов её вызова. //! и конструирует новый массив из результатов её вызова.
//! \~\code //! \~\code
//! PIVector<int> v{1, 2, 3}; //! PIVector<int> v{1, 2, 3};
@@ -2333,7 +2334,7 @@ public:
//! \~russian Изменяет размерность массива, из двухмерный массива создает одномерный. //! \~russian Изменяет размерность массива, из двухмерный массива создает одномерный.
//! \~\details //! \~\details
//! \~russian Делает массив плоским. //! \~russian Делает массив плоским.
//! Порядок обхода исходного массива, задаётся с помощью \a ReshapeOrder. //! Порядок обхода исходного массива задаётся с помощью \a ReshapeOrder.
//! \~english Makes the array flat. //! \~english Makes the array flat.
//! Еhe order of traversing the source array is set using \a ReshapeOrder. //! Еhe order of traversing the source array is set using \a ReshapeOrder.
//! \~\code //! \~\code