stlab.adobe.com Adobe Systems Incorporated
lexicographical_compare.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_ALGORITHM_LEXICOGRAPHICAL_COMPARE_HPP
10 #define ADOBE_ALGORITHM_LEXICOGRAPHICAL_COMPARE_HPP
11 
12 #include <adobe/config.hpp>
13 
14 #include <boost/range/begin.hpp>
15 #include <boost/range/end.hpp>
16 #include <boost/bind.hpp>
17 
18 #include <algorithm>
19 
20 /*************************************************************************************************/
21 
22 namespace adobe {
23 
24 /*************************************************************************************************/
32 /*************************************************************************************************/
38 template <class InputRange1, class InputRange2>
39 inline bool lexicographical_compare(const InputRange1& range1, const InputRange2& range2)
40 {
41  return std::lexicographical_compare(boost::begin(range1), boost::end(range1),
42  boost::begin(range2), boost::end(range2));
43 }
44 
50 template <class InputIterator1, class InputIterator2, class Compare>
51 inline bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1,
52  InputIterator2 first2, InputIterator2 last2,
53  Compare comp)
54 
55 {
56  return std::lexicographical_compare(first1, last1, first2, last2, boost::bind(comp, _1, _2));
57 }
58 
64 template <class InputRange1, class InputRange2, class Compare>
65 inline bool
66 lexicographical_compare(const InputRange1& range1, const InputRange2& range2, Compare comp)
67 {
68  return adobe::lexicographical_compare( boost::begin(range1), boost::end(range1),
69  boost::begin(range2), boost::end(range2),
70  comp);
71 }
72 
73 /*************************************************************************************************/
74 
75 } // namespace adobe
76 
77 /*************************************************************************************************/
78 
79 #endif
80 
81 /*************************************************************************************************/

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