libsequence  1.9.5
CountingOperators.hpp
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2003-2009 Kevin Thornton, krthornt[]@[]uci.edu
4 
5 Remove the brackets to email me.
6 
7 This file is part of libsequence.
8 
9 libsequence is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 libsequence is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 long with libsequence. If not, see <http://www.gnu.org/licenses/>.
21 
22 */
23 
69 #ifndef __COUNTING_OPERATORS_HPP__
70 #define __COUNTING_OPERATORS_HPP__
71 #include <algorithm>
72 #include <functional>
73 #include <map>
74 #include <vector>
75 #include <set>
76 namespace Sequence
77 {
78  template<typename key,typename value>
79  struct first_is_equal : public std::binary_function< std::pair<key,value>,
80  std::pair<key,value>,bool>
84  {
85  inline bool operator()(const std::pair<key,value> &l,
86  const std::pair<key,value> &r) const
90  {
91  return l.first==r.first;
92  }
93  };
94 
106  template<typename key, typename value>
107  std::vector<std::pair<key,value> >
108  operator+(const std::vector<std::pair<key,value> > &lhs,
109  const std::vector<std::pair<key,value> > &rhs);
110 
111 
118  template<typename key, typename value>
119  std::vector<std::pair<key,value> >
120  operator+=( std::vector<std::pair<key,value> > &lhs,
121  const std::vector<std::pair<key,value> > &rhs);
122 
134  template< typename key, typename value,
135  typename comparison>
136  std::map<key,value,comparison> operator+(const std::map<key,value,comparison> &lhs,
137  const std::map<key,value,comparison> &rhs);
138 
145  template< typename key, typename value, typename comparison>
146  std::map<key,value,comparison> operator+=( std::map<key,value,comparison> &lhs,
147  const std::map<key,value,comparison> &rhs);
148 }
149 #include <Sequence/bits/CountingOperators.tcc>
150 #endif
bool operator()(const std::pair< key, value > &l, const std::pair< key, value > &r) const
The namespace in which this library resides.
Functor that checks for equality of first member of two pairs.
col_view_iterator< POINTER > & operator+=(col_view_iterator< POINTER > &i, typename col_view_iterator< POINTER >::difference_type d)
col_view_iterator< POINTER > operator+(col_view_iterator< POINTER > i, typename col_view_iterator< POINTER >::difference_type d)