Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2004-05-23 05:06:46


Hi,

I added several algorithms that extent STL algorithms set. I use them in my
Boost.Test development. But since they seems to be generic and IMO should be
present in STL I propose to push them in boost/algorithm.hpp (or under
boost/algorithm). I remember there was a discussion already about these
algorithms. Here is the list (I hope name and spec is self -explanatory):

template <class InputIter1, class InputIter2>
inline std::pair<InputIter1, InputIter2>
mismatch( InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2
last2 );

template <class InputIter1, class InputIter2, class Predicate>
inline std::pair<InputIter1, InputIter2>
mismatch( InputIter1 first1, InputIter1 last1,
                InputIter2 first2, InputIter2 last2,
                Predicate pred );

template<class ForwardIterator1, class ForwardIterator2>
inline ForwardIterator1
find_first_not_of( ForwardIterator1 first1, ForwardIterator1 last1,
                           ForwardIterator2 first2, ForwardIterator2
last2 );

template<class ForwardIterator1, class ForwardIterator2, class Predicate>
inline ForwardIterator1
find_first_not_of( ForwardIterator1 first1, ForwardIterator1 last1,
                           ForwardIterator2 first2, ForwardIterator2 last2,
                           Predicate pred );

template<class BidirectionalIterator1, class ForwardIterator2>
inline BidirectionalIterator1
find_last_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1,
                    ForwardIterator2 first2, ForwardIterator2 last2 )

template<class BidirectionalIterator1, class ForwardIterator2, class
Predicate>
inline BidirectionalIterator1
find_last_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1,
                    ForwardIterator2 first2, ForwardIterator2 last2,
                    Predicate pred );

template<class BidirectionalIterator1, class ForwardIterator2>
inline BidirectionalIterator1
find_last_not_of( BidirectionalIterator1 first1, BidirectionalIterator1
last1,
                           ForwardIterator2 first2, ForwardIterator2
last2 );

template<class BidirectionalIterator1, class ForwardIterator2, class
Predicate>
inline BidirectionalIterator1
find_last_not_of( BidirectionalIterator1 first1, BidirectionalIterator1
last1,
                           ForwardIterator2 first2, ForwardIterator2 last2,
                           Predicate pred );

Implementation together with doxigen docs is here:

http://tinyurl.com/35pfj

Test is here:

http://tinyurl.com/yvlgu

If we don't find this header eligible for review I would like to ask then
for permision to at least put this algorithm in boost namespace (currently
boost::unit_test), for it inconvenience for me to keep it in deep namespace.

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk