New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
equal_range.hpp in vendors/XIOS/current/extern/boost/include/boost/range/algorithm – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/range/algorithm/equal_range.hpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1//  Copyright Neil Groves 2009. Use, modification and
2//  distribution is subject to the Boost Software License, Version
3//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
4//  http://www.boost.org/LICENSE_1_0.txt)
5//
6//
7// For more information, see http://www.boost.org/libs/range/
8//
9#ifndef BOOST_RANGE_ALGORITHM_EQUAL_RANGE_HPP_INCLUDED
10#define BOOST_RANGE_ALGORITHM_EQUAL_RANGE_HPP_INCLUDED
11
12#include <boost/concept_check.hpp>
13#include <boost/range/begin.hpp>
14#include <boost/range/end.hpp>
15#include <boost/range/concepts.hpp>
16#include <algorithm>
17
18namespace boost
19{
20    namespace range
21    {
22
23/// \brief template function equal_range
24///
25/// range-based version of the equal_range std algorithm
26///
27/// \pre ForwardRange is a model of the ForwardRangeConcept
28/// \pre SortPredicate is a model of the BinaryPredicateConcept
29template<class ForwardRange, class Value>
30inline std::pair<
31        BOOST_DEDUCED_TYPENAME boost::range_iterator<ForwardRange>::type,
32        BOOST_DEDUCED_TYPENAME boost::range_iterator<ForwardRange>::type
33       >
34equal_range(ForwardRange& rng, const Value& val)
35{
36    BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
37    return std::equal_range(boost::begin(rng), boost::end(rng), val);
38}
39
40/// \overload
41template<class ForwardRange, class Value>
42inline std::pair<
43        BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type,
44        BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type
45       >
46equal_range(const ForwardRange& rng, const Value& val)
47{
48    BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
49    return std::equal_range(boost::begin(rng), boost::end(rng), val);
50}
51
52/// \overload
53template<class ForwardRange, class Value, class SortPredicate>
54inline std::pair<
55        BOOST_DEDUCED_TYPENAME boost::range_iterator<ForwardRange>::type,
56        BOOST_DEDUCED_TYPENAME boost::range_iterator<ForwardRange>::type
57       >
58equal_range(ForwardRange& rng, const Value& val, SortPredicate pred)
59{
60    BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
61    return std::equal_range(boost::begin(rng), boost::end(rng), val, pred);
62}
63
64/// \overload
65template<class ForwardRange, class Value, class SortPredicate>
66inline std::pair<
67        BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type,
68        BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type
69       >
70equal_range(const ForwardRange& rng, const Value& val, SortPredicate pred)
71{
72    BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
73    return std::equal_range(boost::begin(rng), boost::end(rng), val, pred);
74}
75
76    } // namespace range
77    using range::equal_range;
78} // namespace boost
79
80#endif // include guard
Note: See TracBrowser for help on using the repository browser.