• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

libkleo

  • sources
  • kde-4.12
  • kdepim
  • libkleo
  • kleo
stl_util.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2007 Klarälvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Tools library.
5 **
6 ** This file may be distributed and/or modified under the terms of the
7 ** GNU General Public License version 2 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.GPL included in the
9 ** packaging of this file.
10 **
11 ** Licensees holding valid commercial KD Tools licenses may use this file in
12 ** accordance with the KD Tools Commercial License Agreement provided with
13 ** the Software.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
19 ** licensing are not clear to you.
20 **
21 **********************************************************************/
22 #ifndef __KDTOOLSCORE_STL_UTIL_H__
23 #define __KDTOOLSCORE_STL_UTIL_H__
24 
25 #include <boost/range.hpp>
26 #include <boost/iterator/filter_iterator.hpp>
27 #include <boost/iterator/transform_iterator.hpp>
28 #include <boost/call_traits.hpp>
29 #include <boost/version.hpp>
30 
31 #include <algorithm>
32 #include <numeric>
33 #include <utility>
34 #include <iterator>
35 #include <functional>
36 
37 namespace kdtools {
38 
39  struct nodelete {
40  template <typename T>
41  void operator()( const T * ) const {}
42  };
43 
44  struct identity {
45  template <typename T>
46  T * operator()( T * t ) const { return t; }
47  template <typename T>
48  const T * operator()( const T * t ) const { return t; }
49  template <typename T>
50  T & operator()( T & t ) const { return t; }
51  template <typename T>
52  const T & operator()( const T & t ) const { return t; }
53  };
54 
55  template <typename Pair>
56  struct select1st;
57 
58  template <typename U, typename V>
59  struct select1st< std::pair<U,V> >
60  : std::unary_function<std::pair<U,V>,U>
61  {
62  typename boost::call_traits<U>::param_type
63  operator()( const std::pair<U,V> & pair ) const { return pair.first; }
64  };
65 
66  template <typename Pair>
67  struct select2nd;
68 
69  template <typename U, typename V>
70  struct select2nd< std::pair<U,V> >
71  : std::unary_function<std::pair<U,V>,V>
72  {
73  typename boost::call_traits<V>::param_type
74  operator()( const std::pair<U,V> & pair ) const { return pair.second; }
75  };
76 
77 
78  template <typename InputIterator, typename OutputIterator, typename UnaryPredicate>
79  OutputIterator copy_if( InputIterator first, InputIterator last, OutputIterator dest, UnaryPredicate pred ) {
80  while ( first != last ) {
81  if ( pred( *first ) ) {
82  *dest = *first;
83  ++dest;
84  }
85  ++first;
86  }
87  return dest;
88  }
89 
90  template <typename OutputIterator, typename InputIterator, typename UnaryFunction, typename UnaryPredicate>
91  OutputIterator transform_if( InputIterator first, InputIterator last, OutputIterator dest, UnaryPredicate pred, UnaryFunction filter ) {
92  return std::transform( boost::make_filter_iterator( filter, first, last ),
93  boost::make_filter_iterator( filter, last, last ),
94  dest, pred );
95  }
96 
97  template <typename InputIterator, typename OutputIterator>
98  OutputIterator copy_1st( InputIterator first, InputIterator last, OutputIterator dest ) {
99  return std::copy( boost::make_transform_iterator( first, select1st<typename std::iterator_traits<InputIterator>::value_type>() ),
100  boost::make_transform_iterator( last, select1st<typename std::iterator_traits<InputIterator>::value_type>() ),
101  dest );
102  }
103 
104  template <typename InputIterator, typename OutputIterator>
105  OutputIterator copy_2nd( InputIterator first, InputIterator last, OutputIterator dest ) {
106  return std::copy( boost::make_transform_iterator( first, select2nd<typename std::iterator_traits<InputIterator>::value_type>() ),
107  boost::make_transform_iterator( last, select2nd<typename std::iterator_traits<InputIterator>::value_type>() ),
108  dest );
109  }
110 
111  template <typename InputIterator, typename OutputIterator, typename Predicate>
112  OutputIterator copy_1st_if( InputIterator first, InputIterator last, OutputIterator dest, Predicate pred ) {
113  return kdtools::copy_if( boost::make_transform_iterator( first, select1st<typename std::iterator_traits<InputIterator>::value_type>() ),
114  boost::make_transform_iterator( last, select1st<typename std::iterator_traits<InputIterator>::value_type>() ),
115  dest, pred );
116  }
117 
118  template <typename InputIterator, typename OutputIterator, typename Predicate>
119  OutputIterator copy_2nd_if( InputIterator first, InputIterator last, OutputIterator dest, Predicate pred ) {
120  return kdtools::copy_if( boost::make_transform_iterator( first, select2nd<typename std::iterator_traits<InputIterator>::value_type>() ),
121  boost::make_transform_iterator( last, select2nd<typename std::iterator_traits<InputIterator>::value_type>() ),
122  dest, pred );
123  }
124 
125  template <typename OutputIterator, typename InputIterator, typename UnaryFunction>
126  OutputIterator transform_1st( InputIterator first, InputIterator last, OutputIterator dest, UnaryFunction func ) {
127  return std::transform( boost::make_transform_iterator( first, select1st<typename std::iterator_traits<InputIterator>::value_type>() ),
128  boost::make_transform_iterator( last, select1st<typename std::iterator_traits<InputIterator>::value_type>() ),
129  dest, func );
130  }
131 
132  template <typename OutputIterator, typename InputIterator, typename UnaryFunction>
133  OutputIterator transform_2nd( InputIterator first, InputIterator last, OutputIterator dest, UnaryFunction func ) {
134  return std::transform( boost::make_transform_iterator( first, select2nd<typename std::iterator_traits<InputIterator>::value_type>() ),
135  boost::make_transform_iterator( last, select2nd<typename std::iterator_traits<InputIterator>::value_type>() ),
136  dest, func );
137  }
138 
139  template <typename Value, typename InputIterator, typename UnaryPredicate>
140  Value accumulate_if( InputIterator first, InputIterator last, UnaryPredicate filter, const Value & value=Value() ) {
141  return std::accumulate( boost::make_filter_iterator( filter, first, last ),
142  boost::make_filter_iterator( filter, last, last ), value );
143  }
144 
145  template <typename Value, typename InputIterator, typename UnaryPredicate, typename BinaryOperation>
146  Value accumulate_if( InputIterator first, InputIterator last, UnaryPredicate filter, const Value & value, BinaryOperation op ) {
147  return std::accumulate( boost::make_filter_iterator( filter, first, last ),
148  boost::make_filter_iterator( filter, last, last ), value, op );
149  }
150 
151  template <typename Value, typename InputIterator, typename UnaryFunction>
152  Value accumulate_transform( InputIterator first, InputIterator last, UnaryFunction map, const Value & value=Value() ) {
153  return std::accumulate( boost::make_transform_iterator( first, map ),
154  boost::make_transform_iterator( last, map ), value );
155  }
156 
157  template <typename Value, typename InputIterator, typename UnaryFunction, typename BinaryOperation>
158  Value accumulate_transform( InputIterator first, InputIterator last, UnaryFunction map, const Value & value, BinaryOperation op ) {
159  return std::accumulate( boost::make_transform_iterator( first, map ),
160  boost::make_transform_iterator( last, map ), value, op );
161  }
162 
163  template <typename Value, typename InputIterator, typename UnaryFunction, typename UnaryPredicate>
164  Value accumulate_transform_if( InputIterator first, InputIterator last, UnaryFunction map, UnaryPredicate pred, const Value & value=Value() ) {
165  return std::accumulate( boost::make_transform_iterator( first, map ),
166  boost::make_transform_iterator( last, map ), value );
167  }
168 
169  template <typename Value, typename InputIterator, typename UnaryFunction, typename UnaryPredicate, typename BinaryOperation>
170  Value accumulate_transform_if( InputIterator first, InputIterator last, UnaryFunction map, UnaryPredicate filter, const Value & value, BinaryOperation op ) {
171  return std::accumulate( boost::make_transform_iterator( boost::make_filter_iterator( filter, first, last ), map ),
172  boost::make_transform_iterator( boost::make_filter_iterator( filter, last, last ), map ), value, op );
173  }
174 
175  template <typename InputIterator, typename OutputIterator1, typename OutputIterator2, typename UnaryPredicate>
176  std::pair<OutputIterator1,OutputIterator2> separate_if( InputIterator first, InputIterator last, OutputIterator1 dest1, OutputIterator2 dest2, UnaryPredicate pred ) {
177  while ( first != last ) {
178  if ( pred( *first ) ) {
179  *dest1 = *first;
180  ++dest1;
181  } else {
182  *dest2 = *first;
183  ++dest2;
184  }
185  ++first;
186  }
187  return std::make_pair( dest1, dest2 );
188  }
189 
190  template <typename InputIterator>
191  bool any( InputIterator first, InputIterator last ) {
192  while ( first != last )
193  if ( *first )
194  return true;
195  else
196  ++first;
197  return false;
198  }
199 
200  template <typename InputIterator, typename UnaryPredicate>
201  bool any( InputIterator first, InputIterator last, UnaryPredicate pred ) {
202  while ( first != last )
203  if ( pred( *first ) )
204  return true;
205  else
206  ++first;
207  return false;
208  }
209 
210  template <typename InputIterator>
211  bool all( InputIterator first, InputIterator last ) {
212  while ( first != last )
213  if ( *first )
214  ++first;
215  else
216  return false;
217  return true;
218  }
219 
220  template <typename InputIterator, typename UnaryPredicate>
221  bool all( InputIterator first, InputIterator last, UnaryPredicate pred ) {
222  while ( first != last )
223  if ( pred( *first ) )
224  ++first;
225  else
226  return false;
227  return true;
228  }
229 
230  template <typename InputIterator>
231  bool none_of( InputIterator first, InputIterator last ) {
232  return !any( first, last );
233  }
234 
235  template <typename InputIterator, typename UnaryPredicate>
236  bool none_of( InputIterator first, InputIterator last, UnaryPredicate pred ) {
237  return !any( first, last, pred );
238  }
239 
240  template <typename InputIterator, typename BinaryOperation>
241  BinaryOperation for_each_adjacent_pair( InputIterator first, InputIterator last, BinaryOperation op ) {
242  typedef typename std::iterator_traits<InputIterator>::value_type ValueType;
243  if ( first == last )
244  return op;
245  ValueType value = *first;
246  while ( ++first != last ) {
247  ValueType tmp = *first;
248  op( value, tmp );
249  value = tmp;
250  }
251  return op;
252  }
253 
254  template <typename ForwardIterator, typename UnaryPredicate, typename UnaryFunction>
255  UnaryFunction for_each_if( ForwardIterator first, ForwardIterator last, UnaryPredicate pred, UnaryFunction func ) {
256  return std::for_each( boost::make_filter_iterator( pred, first, last ),
257  boost::make_filter_iterator( pred, last, last ),
258  func );
259  }
260 
262 
265  template <typename ForwardIterator, typename ForwardIterator2, typename OutputIterator, typename BinaryPredicate>
266  OutputIterator set_intersection( ForwardIterator first1, ForwardIterator last1, ForwardIterator2 first2, ForwardIterator2 last2, OutputIterator result ) {
267  while ( first1 != last1 && first2 != last2 ) {
268  if ( *first1 < *first2 ) {
269  first1 = std::lower_bound( ++first1, last1, *first2 );
270  } else if ( *first2 < *first1 ) {
271  first2 = std::lower_bound( ++first2, last2, *first1 );
272  } else {
273  *result = *first1;
274  ++first1;
275  ++first2;
276  ++result;
277  }
278  }
279  return result;
280  }
281 
282  template <typename ForwardIterator, typename ForwardIterator2, typename OutputIterator, typename BinaryPredicate>
283  OutputIterator set_intersection( ForwardIterator first1, ForwardIterator last1, ForwardIterator2 first2, ForwardIterator2 last2, OutputIterator result, BinaryPredicate pred ) {
284  while ( first1 != last1 && first2 != last2 ) {
285  if ( pred( *first1, *first2 ) ) {
286  first1 = std::lower_bound( ++first1, last1, *first2, pred );
287  } else if ( pred( *first2, *first1 ) ) {
288  first2 = std::lower_bound( ++first2, last2, *first1, pred );
289  } else {
290  *result = *first1;
291  ++first1;
292  ++first2;
293  ++result;
294  }
295  }
296  return result;
297  }
299 
300  template <typename ForwardIterator, typename ForwardIterator2, typename BinaryPredicate>
301  bool set_intersects( ForwardIterator first1, ForwardIterator last1,
302  ForwardIterator2 first2, ForwardIterator2 last2,
303  BinaryPredicate pred )
304  {
305  while ( first1 != last1 && first2 != last2 ) {
306  if ( pred( *first1, *first2 ) ) {
307  first1 = std::lower_bound( ++first1, last1, *first2, pred );
308  } else if ( pred( *first2, *first1 ) ) {
309  first2 = std::lower_bound( ++first2, last2, *first1, pred );
310  } else {
311  return true;
312  }
313  }
314  return false;
315  }
316 
318 
320  template <typename C, typename V>
321  typename boost::range_iterator<C>::type
322  find( C & c, const V & v ) {
323  return std::find( boost::begin( c ), boost::end( c ), v );
324  }
325 
326 #if BOOST_VERSION < 103500
327  template <typename C, typename V>
328  typename boost::range_const_iterator<C>::type
329  find( const C & c, const V & v ) {
330  return std::find( boost::begin( c ), boost::end( c ), v );
331  }
332 #endif
333 
334  template <typename C, typename P>
335  typename boost::range_iterator<C>::type
336  find_if( C & c, P p ) {
337  return std::find_if( boost::begin( c ), boost::end( c ), p );
338  }
339 
340 #if BOOST_VERSION < 103500
341  template <typename C, typename P>
342  typename boost::range_const_iterator<C>::type
343  find_if( const C & c, P p ) {
344  return std::find_if( boost::begin( c ), boost::end( c ), p );
345  }
346 #endif
347 
348  template <typename C, typename V>
349  bool contains( const C & c, const V & v ) {
350  return find( c, v ) != boost::end( c ) ;
351  }
352 
353  template <typename C, typename P>
354  bool contains_if( const C & c, P p ) {
355  return find_if( c, p ) != boost::end( c );
356  }
357 
358  template <typename C, typename V>
359  bool binary_search( const C & c, const V & v ) {
360  return std::binary_search( boost::begin( c ), boost::end( c ), v );
361  }
362 
363  template <typename C, typename V>
364  size_t count( const C & c, const V & v ) {
365  return std::count( boost::begin( c ), boost::end( c ), v );
366  }
367 
368  template <typename C, typename P>
369  size_t count_if( const C & c, P p ) {
370  return std::count_if( boost::begin( c ), boost::end( c ), p );
371  }
372 
373  template <typename O, typename I, typename P>
374  O transform( const I & i, P p ) {
375  O o;
376  std::transform( boost::begin( i ), boost::end( i ),
377  std::back_inserter( o ), p );
378  return o;
379  }
380 
381  template <typename I, typename OutputIterator, typename P>
382  OutputIterator transform( const I & i, OutputIterator out, P p ) {
383  return std::transform( boost::begin( i ), boost::end( i ), out, p );
384  }
385 
386  template <typename O, typename I, typename P, typename F>
387  O transform_if( const I & i, P p, F f ) {
388  O o;
389  transform_if( boost::begin( i ), boost::end( i ),
390  std::back_inserter( o ), p, f );
391  return o;
392  }
393 
394  template <typename V, typename I, typename F>
395  V accumulate_if( const I & i, F f, V v=V() ) {
396  return accumulate_if( boost::begin( i ), boost::end( i ), f, v );
397  }
398 
399  template <typename V, typename I, typename F, typename B>
400  V accumulate_if( const I & i, F f, V v, B b ) {
401  return accumulate_if( boost::begin( i ), boost::end( i ), f, v, b );
402  }
403 
404  template <typename V, typename I, typename F>
405  V accumulate_transform( const I & i, F f, V v=V() ) {
406  return accumulate_transform( boost::begin( i ), boost::end( i ), f, v );
407  }
408 
409  template <typename V, typename I, typename F, typename B>
410  V accumulate_transform( const I & i, F f, V v, B b ) {
411  return accumulate_transform( boost::begin( i ), boost::end( i ), f, v, b );
412  }
413 
414  template <typename V, typename I, typename F, typename P>
415  V accumulate_transform_if( const I & i, F f, P p, V v=V() ) {
416  return accumulate_transform_if( boost::begin( i ), boost::end( i ), f, p, v );
417  }
418 
419  template <typename V, typename I, typename F, typename P, typename B>
420  V accumulate_transform_if( const I & i, F f, P p, V v, B b ) {
421  return accumulate_transform_if( boost::begin( i ), boost::end( i ), f, p, v, b );
422  }
423 
424  template <typename O, typename I>
425  O copy( const I & i ) {
426  O o;
427  std::copy( boost::begin( i ), boost::end( i ), std::back_inserter( o ) );
428  return o;
429  }
430 
431  template <typename O, typename I, typename P>
432  O copy_if( const I & i, P p ) {
433  O o;
434  kdtools::copy_if( boost::begin( i ), boost::end( i ), std::back_inserter( o ), p );
435  return o;
436  }
437 
438  template <typename I, typename P>
439  P for_each( const I & i, P p ) {
440  return std::for_each( boost::begin( i ), boost::end( i ), p );
441  }
442 
443  template <typename I, typename P>
444  P for_each( I & i, P p ) {
445  return std::for_each( boost::begin( i ), boost::end( i ), p );
446  }
447 
448  template <typename C1, typename C2>
449  bool equal( const C1 & c1, const C2 & c2 ) {
450  return boost::size( c1 ) == boost::size( c2 )
451  && std::equal( boost::begin( c1 ), boost::end( c1 ),
452  boost::begin( c2 ) );
453  }
454 
455  template <typename C1, typename C2, typename P>
456  bool equal( const C1 & c1, const C2 & c2, P p ) {
457  return boost::size( c1 ) == boost::size( c2 )
458  && std::equal( boost::begin( c1 ), boost::end( c1 ),
459  boost::begin( c2 ), p );
460  }
461 
462  template <typename C, typename O1, typename O2, typename P>
463  std::pair<O1,O2> separate_if( const C & c, O1 o1, O2 o2, P p ) {
464  return separate_if( boost::begin( c ), boost::end( c ), o1, o2, p );
465  }
466 
468 
469  template <typename C>
470  bool any( const C & c ) {
471  return any( boost::begin( c ), boost::end( c ) );
472  }
473 
474  template <typename C, typename P>
475  bool any( const C & c, P p ) {
476  return any( boost::begin( c ), boost::end( c ), p );
477  }
478 
479  template <typename C>
480  bool all( const C & c ) {
481  return all( boost::begin( c ), boost::end( c ) );
482  }
483 
484  template <typename C, typename P>
485  bool all( const C & c, P p ) {
486  return all( boost::begin( c ), boost::end( c ), p );
487  }
488 
489  template <typename C>
490  bool none_of( const C & c ) {
491  return none_of( boost::begin( c ), boost::end( c ) );
492  }
493 
494  template <typename C, typename P>
495  bool none_of( const C & c, P p ) {
496  return kdtools::none_of( boost::begin( c ), boost::end( c ), p );
497  }
498 
499  template <typename C, typename B>
500  B for_each_adjacent_pair( const C & c, B b ) {
501  return for_each_adjacent_pair( boost::begin( c ), boost::end( c ), b );
502  }
503 
504  template <typename C, typename B>
505  B for_each_adjacent_pair( C & c, B b ) {
506  return for_each_adjacent_pair( boost::begin( c ), boost::end( c ), b );
507  }
508 
509  template <typename C, typename P, typename F>
510  P for_each_if( const C & c, P p, F f ) {
511  return for_each_if( boost::begin( c ), boost::end( c ), p, f );
512  }
513 
514  template <typename C, typename P, typename F>
515  P for_each_if( C & c, P p, F f ) {
516  return for_each_if( boost::begin( c ), boost::end( c ), p, f );
517  }
518 
519  template <typename C>
520  void sort( C & c ) {
521  return std::sort( boost::begin( c ), boost::end( c ) );
522  }
523 
524  template <typename C, typename P>
525  void sort( C & c, P p ) {
526  return std::sort( boost::begin( c ), boost::end( c ), p );
527  }
528 
529  template <typename C>
530  C sorted( const C & c ) {
531  C copy( c );
532  kdtools::sort( copy );
533  return copy;
534  }
535 
536  template <typename C, typename P>
537  C sorted( const C & c, P p ) {
538  C copy( c );
539  kdtools::sort( copy, p );
540  return copy;
541  }
542 
543 }
544 
545 #endif /* __KDTOOLSCORE_STL_UTIL_H__ */
546 
kdtools::identity::operator()
T & operator()(T &t) const
Definition: stl_util.h:50
kdtools::for_each_adjacent_pair
BinaryOperation for_each_adjacent_pair(InputIterator first, InputIterator last, BinaryOperation op)
Definition: stl_util.h:241
kdtools::contains
bool contains(const C &c, const V &v)
Definition: stl_util.h:349
kdtools::sort
void sort(C &c, P p)
Definition: stl_util.h:525
kdtools::equal
bool equal(const C1 &c1, const C2 &c2)
Definition: stl_util.h:449
kdtools::none_of
bool none_of(InputIterator first, InputIterator last)
Definition: stl_util.h:231
kdtools::find_if
boost::range_const_iterator< C >::type find_if(const C &c, P p)
Definition: stl_util.h:343
kdtools::all
bool all(InputIterator first, InputIterator last)
Definition: stl_util.h:211
kdtools::select1st< std::pair< U, V > >::operator()
boost::call_traits< U >::param_type operator()(const std::pair< U, V > &pair) const
Definition: stl_util.h:63
kdtools::equal
bool equal(const C1 &c1, const C2 &c2, P p)
Definition: stl_util.h:456
kdtools::transform_if
OutputIterator transform_if(InputIterator first, InputIterator last, OutputIterator dest, UnaryPredicate pred, UnaryFunction filter)
Definition: stl_util.h:91
Kleo::QGpgMEProgressTokenMapper::map
QString map(const char *token, int subtoken)
Definition: qgpgmeprogresstokenmapper.cpp:91
kdtools::identity::operator()
const T & operator()(const T &t) const
Definition: stl_util.h:52
kdtools::accumulate_transform
Value accumulate_transform(InputIterator first, InputIterator last, UnaryFunction map, const Value &value=Value())
Definition: stl_util.h:152
kdtools::identity::operator()
const T * operator()(const T *t) const
Definition: stl_util.h:48
kdtools::copy_if
OutputIterator copy_if(InputIterator first, InputIterator last, OutputIterator dest, UnaryPredicate pred)
Definition: stl_util.h:79
kdtools::for_each
P for_each(I &i, P p)
Definition: stl_util.h:444
kdtools::transform_1st
OutputIterator transform_1st(InputIterator first, InputIterator last, OutputIterator dest, UnaryFunction func)
Definition: stl_util.h:126
kdtools::count
size_t count(const C &c, const V &v)
Definition: stl_util.h:364
kdtools::copy_1st
OutputIterator copy_1st(InputIterator first, InputIterator last, OutputIterator dest)
Definition: stl_util.h:98
kdtools::nodelete
Definition: stl_util.h:39
kdtools::identity::operator()
T * operator()(T *t) const
Definition: stl_util.h:46
kdtools::transform_2nd
OutputIterator transform_2nd(InputIterator first, InputIterator last, OutputIterator dest, UnaryFunction func)
Definition: stl_util.h:133
kdtools::transform
O transform(const I &i, P p)
Definition: stl_util.h:374
kdtools::contains_if
bool contains_if(const C &c, P p)
Definition: stl_util.h:354
kdtools::separate_if
std::pair< OutputIterator1, OutputIterator2 > separate_if(InputIterator first, InputIterator last, OutputIterator1 dest1, OutputIterator2 dest2, UnaryPredicate pred)
Definition: stl_util.h:176
kdtools::select2nd
Definition: stl_util.h:67
kdtools::for_each_if
UnaryFunction for_each_if(ForwardIterator first, ForwardIterator last, UnaryPredicate pred, UnaryFunction func)
Definition: stl_util.h:255
kdtools::set_intersection
OutputIterator set_intersection(ForwardIterator first1, ForwardIterator last1, ForwardIterator2 first2, ForwardIterator2 last2, OutputIterator result)
Versions of std::set_intersection optimized for ForwardIterator's.
Definition: stl_util.h:266
kdtools::copy
O copy(const I &i)
Definition: stl_util.h:425
kdtools::transform
OutputIterator transform(const I &i, OutputIterator out, P p)
Definition: stl_util.h:382
kdtools::count_if
size_t count_if(const C &c, P p)
Definition: stl_util.h:369
kdtools::accumulate_transform_if
Value accumulate_transform_if(InputIterator first, InputIterator last, UnaryFunction map, UnaryPredicate pred, const Value &value=Value())
Definition: stl_util.h:164
kdtools::any
bool any(InputIterator first, InputIterator last)
Definition: stl_util.h:191
kdtools::copy_2nd_if
OutputIterator copy_2nd_if(InputIterator first, InputIterator last, OutputIterator dest, Predicate pred)
Definition: stl_util.h:119
kdtools::find
boost::range_iterator< C >::type find(C &c, const V &v)
Definition: stl_util.h:322
kdtools::find
boost::range_const_iterator< C >::type find(const C &c, const V &v)
Definition: stl_util.h:329
kdtools::nodelete::operator()
void operator()(const T *) const
Definition: stl_util.h:41
kdtools::identity
Definition: stl_util.h:44
kdtools::set_intersects
bool set_intersects(ForwardIterator first1, ForwardIterator last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred)
Definition: stl_util.h:301
kdtools::accumulate_if
Value accumulate_if(InputIterator first, InputIterator last, UnaryPredicate filter, const Value &value=Value())
Definition: stl_util.h:140
kdtools::for_each
P for_each(const I &i, P p)
Definition: stl_util.h:439
kdtools::sorted
C sorted(const C &c)
Definition: stl_util.h:530
kdtools::copy_2nd
OutputIterator copy_2nd(InputIterator first, InputIterator last, OutputIterator dest)
Definition: stl_util.h:105
kdtools::select1st
Definition: stl_util.h:56
kdtools::find_if
boost::range_iterator< C >::type find_if(C &c, P p)
Definition: stl_util.h:336
kdtools::sort
void sort(C &c)
Definition: stl_util.h:520
kdtools::binary_search
bool binary_search(const C &c, const V &v)
Definition: stl_util.h:359
kdtools::select2nd< std::pair< U, V > >::operator()
boost::call_traits< V >::param_type operator()(const std::pair< U, V > &pair) const
Definition: stl_util.h:74
kdtools::copy_1st_if
OutputIterator copy_1st_if(InputIterator first, InputIterator last, OutputIterator dest, Predicate pred)
Definition: stl_util.h:112
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:57:49 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkleo

Skip menu "libkleo"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal