doc PIMap PIStack PIQueue done

This commit is contained in:
Бычков Андрей
2022-09-02 09:44:47 +03:00
parent db3de9904a
commit eddef26b5e
4 changed files with 100 additions and 20 deletions

View File

@@ -66,23 +66,24 @@ public:
//! \~russian Перемещает элемент в стек.
PIVector<T> & push(T && v) {PIVector<T>::push_back(std::move(v)); return *this;}
//! \~english Retrieves and returns an element from the stack.
//! \~russian Забирает и возвращает элемент из стека.
//! \details
//! \~\note
//! \~english If the stack is empty, it returns the element created by the default constructor.
//! \~russian Если стек пустой то возвращает элемент созданный конструткором по умолчанию.
//! \~\details
//! \note
//! \~english This function assumes that the array isn't empty.
//! Otherwise will be undefined behavior.
//! \~russian Эта функция предполагает, что массив не пустой.
//! Иначе это приведёт к неопределённому поведению программы и ошибкам памяти.
T pop() {return PIVector<T>::take_back();}
//! \~english Last element.
//! \~russian Последний элемент массива.
//! \~english Top element of the stack
//! \~russian Верхний элемент стека.
//! \~\details
//! \~english Returns a reference to the last item in the array.
//! \note
//! \~english Returns a reference to the top element of the stack.
//! This function assumes that the array isn't empty.
//! Otherwise will be undefined behavior.
//! \~russian Возвращает ссылку на последний элемент в массиве.
//! \~russian Возвращает ссылку на верхний элемент стека.
//! Эта функция предполагает, что массив не пустой.
//! Иначе это приведёт к неопределённому поведению программы и ошибкам памяти.
T & top() {return PIVector<T>::back();}
@@ -90,11 +91,11 @@ public:
//! \~english Converts \a PIStack to \a PIVector.
//! \~russian Преобразует \a PIStack в \a PIVector.
PIVector<T> toVector() {return PIVector<T>(*this);}
PIVector<T> toVector() const {return PIVector<T>(*this);}
//! \~english Converts \a PIStack to \a PIDeque.
//! \~russian Преобразует \a PIStack в \a PIDeque.
PIDeque<T> toDeque() {return PIDeque<T>(PIVector<T>::data(), PIVector<T>::size());}
PIDeque<T> toDeque() const {return PIDeque<T>(PIVector<T>::data(), PIVector<T>::size());}
};
#endif // PISTACK_H