annotate DEPENDENCIES/generic/include/boost/range/algorithm/merge.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 // Copyright Neil Groves 2009. Use, modification and
Chris@16 2 // distribution is subject to the Boost Software License, Version
Chris@16 3 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 4 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 5 //
Chris@16 6 //
Chris@16 7 // For more information, see http://www.boost.org/libs/range/
Chris@16 8 //
Chris@16 9 #ifndef BOOST_RANGE_ALGORITHM_MERGE_HPP_INCLUDED
Chris@16 10 #define BOOST_RANGE_ALGORITHM_MERGE_HPP_INCLUDED
Chris@16 11
Chris@16 12 #include <boost/concept_check.hpp>
Chris@16 13 #include <boost/range/begin.hpp>
Chris@16 14 #include <boost/range/end.hpp>
Chris@16 15 #include <boost/range/concepts.hpp>
Chris@16 16 #include <algorithm>
Chris@16 17
Chris@16 18 namespace boost
Chris@16 19 {
Chris@16 20 namespace range
Chris@16 21 {
Chris@16 22
Chris@16 23 /// \brief template function merge
Chris@16 24 ///
Chris@16 25 /// range-based version of the merge std algorithm
Chris@16 26 ///
Chris@16 27 /// \pre SinglePassRange1 is a model of the SinglePassRangeConcept
Chris@16 28 /// \pre SinglePassRange2 is a model of the SinglePassRangeConcept
Chris@16 29 /// \pre BinaryPredicate is a model of the BinaryPredicateConcept
Chris@16 30 ///
Chris@16 31 template<class SinglePassRange1, class SinglePassRange2,
Chris@16 32 class OutputIterator>
Chris@16 33 inline OutputIterator merge(const SinglePassRange1& rng1,
Chris@16 34 const SinglePassRange2& rng2,
Chris@16 35 OutputIterator out)
Chris@16 36 {
Chris@16 37 BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
Chris@16 38 BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
Chris@16 39 return std::merge(boost::begin(rng1), boost::end(rng1),
Chris@16 40 boost::begin(rng2), boost::end(rng2), out);
Chris@16 41 }
Chris@16 42
Chris@16 43 /// \overload
Chris@16 44 template<class SinglePassRange1, class SinglePassRange2,
Chris@16 45 class OutputIterator, class BinaryPredicate>
Chris@16 46 inline OutputIterator merge(const SinglePassRange1& rng1,
Chris@16 47 const SinglePassRange2& rng2,
Chris@16 48 OutputIterator out,
Chris@16 49 BinaryPredicate pred)
Chris@16 50 {
Chris@16 51 BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
Chris@16 52 BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
Chris@16 53 return std::merge(boost::begin(rng1), boost::end(rng1),
Chris@16 54 boost::begin(rng2), boost::end(rng2), out, pred);
Chris@16 55 }
Chris@16 56
Chris@16 57 } // namespace range
Chris@16 58 using range::merge;
Chris@16 59 } // namespace boost
Chris@16 60
Chris@16 61 #endif // include guard