1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_ALGORITHM_EQUAL_RANGE_HPP
12 #define BOOST_COMPUTE_ALGORITHM_EQUAL_RANGE_HPP
16 #include <boost/compute/system.hpp>
17 #include <boost/compute/command_queue.hpp>
18 #include <boost/compute/algorithm/lower_bound.hpp>
19 #include <boost/compute/algorithm/upper_bound.hpp>
24 /// Returns a pair of iterators containing the range of values equal
25 /// to \p value in the sorted range [\p first, \p last).
26 template<class InputIterator, class T>
27 inline std::pair<InputIterator, InputIterator>
28 equal_range(InputIterator first,
31 command_queue &queue = system::default_queue())
33 return std::make_pair(
34 ::boost::compute::lower_bound(first, last, value, queue),
35 ::boost::compute::upper_bound(first, last, value, queue)
39 } // end compute namespace
40 } // end boost namespace
42 #endif // BOOST_COMPUTE_ALGORITHM_EQUAL_RANGE_HPP