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.
inplace_merge.hpp in vendors/XIOS/current/extern/boost/include/boost/range/algorithm – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/range/algorithm/inplace_merge.hpp @ 3428

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

importing initial XIOS vendor drop

File size: 2.5 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_INPLACE_MERGE_HPP_INCLUDED
10#define BOOST_RANGE_ALGORITHM_INPLACE_MERGE_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 inplace_merge
24///
25/// range-based version of the inplace_merge std algorithm
26///
27/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept
28/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
29template<class BidirectionalRange>
30inline BidirectionalRange& inplace_merge(BidirectionalRange& rng,
31    BOOST_DEDUCED_TYPENAME range_iterator<BidirectionalRange>::type middle)
32{
33    BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
34    std::inplace_merge(boost::begin(rng), middle, boost::end(rng));
35    return rng;
36}
37
38/// \overload
39template<class BidirectionalRange>
40inline const BidirectionalRange& inplace_merge(const BidirectionalRange& rng,
41    BOOST_DEDUCED_TYPENAME boost::range_iterator<const BidirectionalRange>::type middle)
42{
43    BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
44    std::inplace_merge(boost::begin(rng), middle, boost::end(rng));
45    return rng;
46}
47
48/// \overload
49template<class BidirectionalRange, class BinaryPredicate>
50inline BidirectionalRange& inplace_merge(BidirectionalRange& rng,
51    BOOST_DEDUCED_TYPENAME boost::range_iterator<BidirectionalRange>::type middle,
52    BinaryPredicate pred)
53{
54    BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
55    std::inplace_merge(boost::begin(rng), middle, boost::end(rng), pred);
56    return rng;
57}
58
59/// \overload
60template<class BidirectionalRange, class BinaryPredicate>
61inline const BidirectionalRange& inplace_merge(const BidirectionalRange& rng,
62    BOOST_DEDUCED_TYPENAME boost::range_iterator<const BidirectionalRange>::type middle,
63    BinaryPredicate pred)
64{
65    BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
66    std::inplace_merge(boost::begin(rng), middle, boost::end(rng), pred);
67    return rng;
68}
69
70    } // namespace range
71    using range::inplace_merge;
72} // namespace boost
73
74#endif // include guard
Note: See TracBrowser for help on using the repository browser.