32 lines
1.4 KiB
C++
32 lines
1.4 KiB
C++
#ifndef PIPAIR_H
|
|
#define PIPAIR_H
|
|
|
|
#include "pibase.h"
|
|
|
|
class PICout;
|
|
|
|
template<typename Type0, typename Type1>
|
|
class PIP_EXPORT PIPair {
|
|
public:
|
|
PIPair() {first = Type0(); second = Type1();}
|
|
PIPair(const Type0 & value0, const Type1 & value1) {first = value0; second = value1;}
|
|
Type0 first;
|
|
Type1 second;
|
|
};
|
|
template<typename Type0, typename Type1>
|
|
inline bool operator <(const PIPair<Type0, Type1> & value0, const PIPair<Type0, Type1> & value1) {return value0.first < value1.first;}
|
|
template<typename Type0, typename Type1>
|
|
inline bool operator ==(const PIPair<Type0, Type1> & value0, const PIPair<Type0, Type1> & value1) {return (value0.first == value1.first) && (value0.second == value1.second);}
|
|
template<typename Type0, typename Type1>
|
|
inline bool operator !=(const PIPair<Type0, Type1> & value0, const PIPair<Type0, Type1> & value1) {return (value0.first != value1.first) || (value0.second != value1.second);}
|
|
|
|
#ifdef PIP_STD_IOSTREAM
|
|
template<typename Type0, typename Type1>
|
|
inline std::ostream & operator <<(std::ostream & s, const PIPair<Type0, Type1> & v) {s << "(" << v.first << ", " << v.second << ")"; return s;}
|
|
#endif
|
|
|
|
template<typename Type0, typename Type1>
|
|
inline PICout operator <<(PICout s, const PIPair<Type0, Type1> & v) {s.space(); s.setControl(0, true); s << "(" << v.first << ", " << v.second << ")"; s.restoreControl(); return s;}
|
|
|
|
#endif // PIPAIR_H
|