00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00069 #ifndef __COUNTING_OPERATORS_HPP__
00070 #define __COUNTING_OPERATORS_HPP__
00071 #include <algorithm>
00072 #include <functional>
00073 #include <map>
00074 #include <set>
00075 namespace Sequence
00076 {
00077 template<typename key,typename value>
00078 struct first_is_equal : public std::binary_function< std::pair<key,value>,
00079 std::pair<key,value>,bool>
00083 {
00084 inline bool operator()(const std::pair<key,value> &l,
00085 const std::pair<key,value> &r) const
00089 {
00090 return l.first==r.first;
00091 }
00092 };
00093
00105 template<typename key, typename value>
00106 std::vector<std::pair<key,value> >
00107 operator+(const std::vector<std::pair<key,value> > &lhs,
00108 const std::vector<std::pair<key,value> > &rhs);
00109
00110
00117 template<typename key, typename value>
00118 std::vector<std::pair<key,value> >
00119 operator+=( std::vector<std::pair<key,value> > &lhs,
00120 const std::vector<std::pair<key,value> > &rhs);
00121
00133 template< typename key, typename value,
00134 typename comparison>
00135 std::map<key,value,comparison> operator+(const std::map<key,value,comparison> &lhs,
00136 const std::map<key,value,comparison> &rhs);
00137
00144 template< typename key, typename value, typename comparison>
00145 std::map<key,value,comparison> operator+=( std::map<key,value,comparison> &lhs,
00146 const std::map<key,value,comparison> &rhs);
00147 }
00148 #include <Sequence/bits/CountingOperators.tcc>
00149 #endif