File indexing completed on 2025-01-30 09:59:16
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_RANGE_ALGORITHM_EQUAL_RANGE_HPP_INCLUDED
0010 #define BOOST_RANGE_ALGORITHM_EQUAL_RANGE_HPP_INCLUDED
0011
0012 #include <boost/concept_check.hpp>
0013 #include <boost/range/begin.hpp>
0014 #include <boost/range/end.hpp>
0015 #include <boost/range/concepts.hpp>
0016 #include <algorithm>
0017
0018 namespace boost
0019 {
0020 namespace range
0021 {
0022
0023
0024
0025
0026
0027
0028
0029 template<class ForwardRange, class Value>
0030 inline std::pair<
0031 BOOST_DEDUCED_TYPENAME boost::range_iterator<ForwardRange>::type,
0032 BOOST_DEDUCED_TYPENAME boost::range_iterator<ForwardRange>::type
0033 >
0034 equal_range(ForwardRange& rng, const Value& val)
0035 {
0036 BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
0037 return std::equal_range(boost::begin(rng), boost::end(rng), val);
0038 }
0039
0040
0041 template<class ForwardRange, class Value>
0042 inline std::pair<
0043 BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type,
0044 BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type
0045 >
0046 equal_range(const ForwardRange& rng, const Value& val)
0047 {
0048 BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
0049 return std::equal_range(boost::begin(rng), boost::end(rng), val);
0050 }
0051
0052
0053 template<class ForwardRange, class Value, class SortPredicate>
0054 inline std::pair<
0055 BOOST_DEDUCED_TYPENAME boost::range_iterator<ForwardRange>::type,
0056 BOOST_DEDUCED_TYPENAME boost::range_iterator<ForwardRange>::type
0057 >
0058 equal_range(ForwardRange& rng, const Value& val, SortPredicate pred)
0059 {
0060 BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
0061 return std::equal_range(boost::begin(rng), boost::end(rng), val, pred);
0062 }
0063
0064
0065 template<class ForwardRange, class Value, class SortPredicate>
0066 inline std::pair<
0067 BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type,
0068 BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type
0069 >
0070 equal_range(const ForwardRange& rng, const Value& val, SortPredicate pred)
0071 {
0072 BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
0073 return std::equal_range(boost::begin(rng), boost::end(rng), val, pred);
0074 }
0075
0076 }
0077 using range::equal_range;
0078 }
0079
0080 #endif