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

libkleo

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

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