~ubuntu-branches/ubuntu/natty/inkscape/natty

« back to all changes in this revision

Viewing changes to src/util/find-last-if.h

  • Committer: Bazaar Package Importer
  • Author(s): Alex Valavanis
  • Date: 2010-09-12 19:44:58 UTC
  • mfrom: (1.1.12 upstream) (45.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20100912194458-4sjwmbl7dlsrk5dc
Tags: 0.48.0-1ubuntu1
* Merge with Debian unstable (LP: #628048, LP: #401567, LP: #456248, 
  LP: #463602, LP: #591986)
* debian/control: 
  - Ubuntu maintainers
  - Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
  - Demote pstoedit to Suggests (universe package).
  - Suggests ttf-dejavu instead of ttf-bitstream-vera (LP: #513319)
* debian/rules:
  - Run intltool-update on build (Ubuntu-specific).
  - Add translation domain to .desktop files (Ubuntu-specific).
* debian/dirs:
  - Add usr/share/pixmaps.  Allow inkscape.xpm installation
* drop 50-poppler-API.dpatch (now upstream)
* drop 51-paste-in-unwritable-directory.dpatch (now upstream) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Inkscape::Algorithms::find_last_if
 
3
 *
 
4
 * Authors:
 
5
 *   MenTaLguY <mental@rydia.net>
 
6
 *
 
7
 * Copyright (C) 2004 MenTaLguY
 
8
 *
 
9
 * Released under GNU GPL, read the file 'COPYING' for more information
 
10
 */
 
11
 
 
12
#ifndef SEEN_INKSCAPE_ALGORITHMS_FIND_LAST_IF_H
 
13
#define SEEN_INKSCAPE_ALGORITHMS_FIND_LAST_IF_H
 
14
 
 
15
#include <algorithm>
 
16
 
 
17
namespace Inkscape {
 
18
 
 
19
namespace Algorithms {
 
20
 
 
21
template <typename ForwardIterator, typename UnaryPredicate>
 
22
inline ForwardIterator find_last_if(ForwardIterator start, ForwardIterator end,
 
23
                                    UnaryPredicate pred)
 
24
{
 
25
    ForwardIterator last_found(end);
 
26
    while ( start != end ) {
 
27
        start = std::find_if(start, end, pred);
 
28
        if ( start != end ) {
 
29
            last_found = start;
 
30
            ++start;
 
31
        }
 
32
    }
 
33
    return last_found;
 
34
}
 
35
 
 
36
}
 
37
 
 
38
}
 
39
 
 
40
#endif
 
41
 
 
42
/*
 
43
  Local Variables:
 
44
  mode:c++
 
45
  c-file-style:"stroustrup"
 
46
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
47
  indent-tabs-mode:nil
 
48
  fill-column:99
 
49
  End:
 
50
*/
 
51
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :