21 #ifndef GNASH_ALGORITHM_H
22 #define GNASH_ALGORITHM_H
25 #include <boost/bind.hpp>
44 template<
typename Container,
typename Predicate>
47 typedef typename Container::iterator iterator;
49 for (iterator
i = c.begin(),
e = c.end();
i !=
e; ) {
50 iterator stored =
i++;
51 if (
p(*stored)) c.erase(stored);
56 template<
typename T,
size_t N>
71 template<
typename T,
typename U>
75 typedef typename std::iterator_traits<T>::value_type value_type;
void EraseIf(Container &c, Predicate p)
Erase elements from an associative container based on a predicate.
Definition: GnashAlgorithm.h:45
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:692
boost::int32_t second
Definition: Date_as.cpp:93
pixel_iterator< T > begin(GnashImage &im)
Definition: ImageIterators.h:191
size_t return N
Get the size of an array without passing a pointer by mistake.
Definition: GnashAlgorithm.h:60
Definition: GnashKey.h:149
T * result_type
Definition: GnashAlgorithm.h:33
Definition: GnashKey.h:166
Return a pointer to a type.
Definition: GnashAlgorithm.h:31
Definition: GnashKey.h:133
Definition: GnashKey.h:132
Definition: GnashKey.h:162
Definition: GnashKey.h:155
Definition: GnashKey.h:151
pixel_iterator< T > end(GnashImage &im)
Definition: ImageIterators.h:198
Definition: GnashKey.h:95
void foreachSecond(T begin, T end, U op)
Call a functor on the second element of each element in a range.
Definition: GnashAlgorithm.h:73
result_type operator()(T &t)
Definition: GnashAlgorithm.h:34