From 91216c4b17ef2464da2eb79d437ca770b17c75d0 Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 22 Apr 2022 19:20:50 +0300 Subject: [PATCH] PIPair doc --- libs/main/containers/pipair.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/libs/main/containers/pipair.h b/libs/main/containers/pipair.h index 8dc066d7..0577e08a 100644 --- a/libs/main/containers/pipair.h +++ b/libs/main/containers/pipair.h @@ -41,7 +41,7 @@ //! \{ //! \class PIPair //! \brief -//! \~english +//! \~english Class template that provides a way to store two heterogeneous objects as a single unit. //! \~russian Класс, который позволяет хранить два разнородных объекта как единое целое. //! \~\} //! \details @@ -51,21 +51,34 @@ template class PIPair { public: + + //! \~english Constructs an empty PIPair. + //! \~russian Создает пустой PIPair. PIPair() : first(), second() {} + + //! \~english Constructs PIPair from [std::tuple](https://en.cppreference.com/w/cpp/utility/tuple). + //! \~russian Создает PIPair из [std::tuple](https://ru.cppreference.com/w/cpp/utility/tuple). PIPair(std::tuple tuple) { first = std::get<0>(tuple); second = std::get<1>(tuple); } + + //! \~english Constructs PIPair from values `value0` and `value1`. + //! \~russian Создает PIPair из `value0` и `value1`. PIPair(const Type0 & value0, const Type1 & value1) { first = value0; second = value1; } + + //! \~english Move constructor. + //! \~russian Перемещающий конструктор. PIPair(Type0 && value0, Type1 && value1) { first = std::move(value0); second = std::move(value1); } - Type0 first; - Type1 second; + + Type0 first /*! \~english First element \~russian Первый элемент */; + Type1 second /*! \~english Second element \~russian Второй элемент */; }; //! \~english Compare operator with PIPair. @@ -90,6 +103,9 @@ inline std::ostream & operator <<(std::ostream & s, const PIPair & } #endif +//! \relatesalso PICout +//! \~english Output operator to \a PICout +//! \~russian Оператор вывода в \a PICout template inline PICout operator <<(PICout s, const PIPair & v) { s.space();