shape_doc 0.1
|
00001 #ifndef ORDERED_PAIR_H 00002 #define ORDERED_PAIR_H 00003 00004 template<class K > 00005 struct ordered_pair { 00006 K first, second; 00007 ordered_pair( const K& a, const K& b ) 00008 { 00009 if ( a < b ) 00010 { first = b; second = a; } 00011 else 00012 { first = a; second = b; }; 00013 }; 00014 00015 bool operator<( const ordered_pair& p ) 00016 { 00017 return first<p.first || (first<p.first) && (second<p.second); }; 00018 }; 00019 00020 00021 #endif