Boost.Range algorithms are now in the boost::range namespace and brought into boost by the appropriate using statement. This allows better interoperation with Boost.Algorithm since errors only occur when the use calls similarly named ambiguous functions. In this event the user can disambiguate by using algorithm::xxx() or range::xxx(). This iteration also updates the concept assert code in the range algorithms.

[SVN r61023]
This commit is contained in:
Neil Groves
2010-04-03 19:14:13 +00:00
parent b4ae711d4e
commit 22c72c53eb
52 changed files with 2766 additions and 2461 deletions

View File

@ -17,153 +17,162 @@
namespace boost
{
/// \brief template function push_heap
///
/// range-based version of the push_heap std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void push_heap(RandomAccessRange& rng)
namespace range
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::push_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange>
inline void push_heap(const RandomAccessRange& rng)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::push_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void push_heap(RandomAccessRange& rng, Compare comp_pred)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::push_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void push_heap(const RandomAccessRange& rng, Compare comp_pred)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::push_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \brief template function pop_heap
///
/// range-based version of the pop_heap std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void pop_heap(RandomAccessRange& rng)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::pop_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange>
inline void pop_heap(const RandomAccessRange& rng)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::pop_heap(boost::begin(rng),boost::end(rng));
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void pop_heap(RandomAccessRange& rng, Compare comp_pred)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void pop_heap(const RandomAccessRange& rng, Compare comp_pred)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \brief template function make_heap
///
/// range-based version of the make_heap std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void make_heap(RandomAccessRange& rng)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::make_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange>
inline void make_heap(const RandomAccessRange& rng)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::make_heap(boost::begin(rng),boost::end(rng));
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void make_heap(RandomAccessRange& rng, Compare comp_pred)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::make_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void make_heap(const RandomAccessRange& rng, Compare comp_pred)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::make_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \brief template function sort_heap
///
/// range-based version of the sort_heap std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void sort_heap(RandomAccessRange& rng)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::sort_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange>
inline void sort_heap(const RandomAccessRange& rng)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::sort_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void sort_heap(RandomAccessRange& rng, Compare comp_pred)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void sort_heap(const RandomAccessRange& rng, Compare comp_pred)
{
boost::function_requires< RandomAccessRangeConcept<RandomAccessRange> >();
std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \brief template function push_heap
///
/// range-based version of the push_heap std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void push_heap(RandomAccessRange& rng)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange>
inline void push_heap(const RandomAccessRange& rng)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void push_heap(RandomAccessRange& rng, Compare comp_pred)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void push_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \brief template function pop_heap
///
/// range-based version of the pop_heap std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void pop_heap(RandomAccessRange& rng)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::pop_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange>
inline void pop_heap(const RandomAccessRange& rng)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::pop_heap(boost::begin(rng),boost::end(rng));
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void pop_heap(RandomAccessRange& rng, Compare comp_pred)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void pop_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \brief template function make_heap
///
/// range-based version of the make_heap std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void make_heap(RandomAccessRange& rng)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::make_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange>
inline void make_heap(const RandomAccessRange& rng)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::make_heap(boost::begin(rng),boost::end(rng));
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void make_heap(RandomAccessRange& rng, Compare comp_pred)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::make_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void make_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::make_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \brief template function sort_heap
///
/// range-based version of the sort_heap std algorithm
///
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
/// \pre Compare is a model of the BinaryPredicateConcept
template<class RandomAccessRange>
inline void sort_heap(RandomAccessRange& rng)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange>
inline void sort_heap(const RandomAccessRange& rng)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng));
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void sort_heap(RandomAccessRange& rng, Compare comp_pred)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
/// \overload
template<class RandomAccessRange, class Compare>
inline void sort_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred);
}
} // namespace range
using range::push_heap;
using range::pop_heap;
using range::make_heap;
using range::sort_heap;
} // namespace boost
#endif // include guard