stlab.adobe.com Adobe Systems Incorporated

equal.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /*************************************************************************************************/
00008 
00009 #ifndef ADOBE_ALGORITHM_EQUAL_HPP
00010 #define ADOBE_ALGORITHM_EQUAL_HPP
00011 
00012 #include <adobe/config.hpp>
00013 
00014 #include <boost/range/begin.hpp>
00015 #include <boost/range/end.hpp>
00016 #include <boost/bind.hpp>
00017 
00018 #include <algorithm>
00019 
00020 /*************************************************************************************************/
00021 
00022 namespace adobe {
00023 
00024 /*************************************************************************************************/
00032 /*************************************************************************************************/
00036 template <class InputIterator1, class InputIterator2, class BinaryPredicate>
00037 inline bool
00038 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred)
00039 {
00040     return std::equal(first1, last1, first2, boost::bind(pred, _1, _2));
00041 }
00042 
00046 template <class InputRange1, class InputIterator2>
00047 inline bool equal(const InputRange1& range1, InputIterator2 first2)
00048 {
00049     return std::equal(boost::begin(range1), boost::end(range1), first2);
00050 }
00051 
00055 template <class InputRange1, class InputIterator2, class BinaryPredicate>
00056 inline bool equal(const InputRange1& range1, InputIterator2 first2, BinaryPredicate pred)
00057 {
00058     return adobe::equal(boost::begin(range1), boost::end(range1), first2, pred);
00059 }
00060 
00061 /*************************************************************************************************/
00062 
00063 } // namespace adobe
00064 
00065 /*************************************************************************************************/
00066 
00067 #endif
00068 
00069 /*************************************************************************************************/

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google