diff --git a/libs/main/containers/pivector.h b/libs/main/containers/pivector.h index 5a9f2e0a..9e5b04a1 100644 --- a/libs/main/containers/pivector.h +++ b/libs/main/containers/pivector.h @@ -1251,6 +1251,24 @@ public: return *this; } + + //! \~\brief + //! \~english Reverses this array. + //! \~russian Обращает порядок следования элементов этого массива. + //! \~\details + //! \~english This method reverses an array [in place](https://en.wikipedia.org/wiki/In-place_algorithm). + //! The first array element becomes the last, and the last array element becomes the first. + //! The reverse method transposes the elements of the calling array object in place, + //! mutating the array, and returning a reference to the array. + //! \~russian Метод reverse() на месте переставляет элементы массива, + //! на котором он был вызван, изменяет массив и возвращает ссылку на него. + //! Первый элемент массива становится последним, а последний — первым. + //! \~\code + //! PIVector v{1, 3, 7, 5}; + //! v.reverse(); + //! piCout << v; // 5, 7, 3, 1 + //! \endcode + //! \~\sa \a reversed() inline PIVector & reverse() { size_t s2 = piv_size/2; for (size_t i = 0; i < s2; ++i) { @@ -1259,6 +1277,15 @@ public: return *this; } + //! \~\brief + //! \~english Returns reversed array. + //! \~russian Возвращает перевернутый массив. + //! \~\details + //! \~english Returns a copy of the array with elements in reverse order. + //! The first array element becomes the last, and the last array element becomes the first. + //! \~russian Возвращает копию массива с элементами в обратном порядке. + //! Первый элемент массива становится последним, а последний — первым. + //! \~\sa \a reverse() inline PIVector reversed() const { PIVector ret(*this); return ret.reverse();