00001 // LICENSETEXT 00002 // 00003 // Copyright (C) 2007 : GreenSocs Ltd 00004 // http://www.greensocs.com/ , email: info@greensocs.com 00005 // 00006 // Developed by : 00007 // 00008 // Wolfgang Klingauf, Robert Guenzel 00009 // Technical University of Braunschweig, Dept. E.I.S. 00010 // http://www.eis.cs.tu-bs.de 00011 // 00012 // Mark Burton, Marcus Bartholomeu 00013 // GreenSocs Ltd 00014 // 00015 // 00016 // This program is free software. 00017 // 00018 // If you have no applicable agreement with GreenSocs Ltd, this software 00019 // is licensed to you, and you can redistribute it and/or modify 00020 // it under the terms of the GNU General Public License as published by 00021 // the Free Software Foundation; either version 2 of the License, or 00022 // (at your option) any later version. 00023 // 00024 // If you have a applicable agreement with GreenSocs Ltd, the terms of that 00025 // agreement prevail. 00026 // 00027 // This program is distributed in the hope that it will be useful, 00028 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00029 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00030 // GNU General Public License for more details. 00031 // 00032 // You should have received a copy of the GNU General Public License 00033 // along with this program; if not, write to the Free Software 00034 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00035 // 02110-1301 USA 00036 // 00037 // ENDLICENSETEXT 00038 00039 00040 #ifndef __gc_unevenpair_h__ 00041 #define __gc_unevenpair_h__ 00042 00043 00044 namespace gs { 00045 namespace ctr { 00046 00047 00048 template<class _T1, class _T2> 00049 struct unevenpair: public std::pair<_T1, _T2> 00050 { 00051 inline bool same(const unevenpair<_T1, _T2>& __x) { 00052 return __x.first == this->first ; 00053 } 00054 00055 // this operator only compares the first element of the pair (for performance reasons) 00056 inline bool operator == (const unevenpair<_T1, _T2>& __x) { 00057 return __x.first == this->first; 00058 } 00059 00060 // this operator only compares the first element of the pair (for performance reasons) 00061 inline bool operator != (const unevenpair<_T1, _T2>& __x) { 00062 return __x.first != this->first; 00063 } 00064 00065 unevenpair(const _T1 &a, const _T2 &b) : std::pair<_T1, _T2>(a,b) {}; 00066 unevenpair() : std::pair<_T1,_T2>() {}; 00067 unevenpair(const unevenpair<_T1, _T2>& __p) : std::pair<_T1,_T2>(__p) {}; 00068 }; 00069 00070 00071 } // end namespace ctr 00072 } // end namespace gs 00073 00074 00075 #endif
1.5.1