/* -*- C++ -*- * src/lemon/extended_pair.h - Part of LEMON, a generic C++ optimization library * * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Combinatorial Optimization Research Group, EGRES). * * Permission to use, modify and distribute this software is granted * provided that this copyright notice appears in all copies. For * precise terms see the accompanying LICENSE file. * * This software is provided "AS IS" with no warranty of any kind, * express or implied, and with no claim as to its suitability for any * purpose. * */ #ifndef LEMON_EXTENDED_PAIR_H #define LEMON_EXTENDED_PAIR_H template struct extended_pair { typedef T1 first_type; typedef T2 second_type; extended_pair() : first(), second() {} extended_pair(A1 f, A2 s) : first(f), second(s) {} template extended_pair(const Pair& pair) : first(pair.first), second(pair.second) {} T1 first; T2 second; }; template bool operator==(const extended_pair& left, const extended_pair& right) { return left.first == right.first && left.second == right.second; } template bool operator!=(const extended_pair& left, const extended_pair& right) { return !(left == right); } template bool operator<(const extended_pair& left, const extended_pair& right) { return left.first < right.first || (!(right.first bool operator>(const extended_pair& left, const extended_pair& right) { return right < left; } template bool operator<=(const extended_pair& left, const extended_pair& right) { return !(right > left); } template bool operator>=(const extended_pair& left, const extended_pair& right) { return !(right < left); } #endif