/*! @file pipair.h * @brief pair * * This file declare PIPair */ /* PIP - Platform Independent Primitives pair Ivan Pelipenko peri4ko@yandex.ru This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef PIPAIR_H #define PIPAIR_H #include "pibase.h" class PICout; template class PIPair { public: PIPair() {first = Type0(); second = Type1();} PIPair(const Type0 & value0, const Type1 & value1) {first = value0; second = value1;} Type0 first; Type1 second; }; template inline bool operator <(const PIPair & value0, const PIPair & value1) {return value0.first < value1.first;} template inline bool operator ==(const PIPair & value0, const PIPair & value1) {return (value0.first == value1.first) && (value0.second == value1.second);} template inline bool operator !=(const PIPair & value0, const PIPair & value1) {return (value0.first != value1.first) || (value0.second != value1.second);} #ifdef PIP_STD_IOSTREAM template inline std::ostream & operator <<(std::ostream & s, const PIPair & v) {s << "(" << v.first << ", " << v.second << ")"; return s;} #endif template inline PICout operator <<(PICout s, const PIPair & v) {s.space(); s.setControl(0, true); s << "(" << v.first << ", " << v.second << ")"; s.restoreControl(); return s;} #endif // PIPAIR_H