// Boost.Geometry // Copyright (c) 2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_GEOMETRY_INDEX_DETAIL_MAXMIN_HEAP_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_MAXMIN_HEAP_HPP #include namespace boost { namespace geometry { namespace index { namespace detail { template inline void push_maxmin_heap(It first, It last, Compare comp) { using namespace minmax_heap_detail; minmax_heap_detail::push_heap(first, last, comp); } template inline void push_maxmin_heap(It first, It last) { using namespace minmax_heap_detail; minmax_heap_detail::push_heap(first, last, std::less<>()); } template inline void pop_top_maxmin_heap(It first, It last, Compare comp) { using namespace minmax_heap_detail; pop_heap(first, first, last, comp); } template inline void pop_top_maxmin_heap(It first, It last) { using namespace minmax_heap_detail; pop_heap(first, first, last, std::less<>()); } template inline void pop_bottom_maxmin_heap(It first, It last, Compare comp) { using namespace minmax_heap_detail; It bottom = minmax_heap_detail::bottom_heap(first, last, comp); pop_heap(first, bottom, last, comp); } template inline void pop_bottom_maxmin_heap(It first, It last) { using namespace minmax_heap_detail; auto&& comp = std::less<>(); It bottom = minmax_heap_detail::bottom_heap(first, last, comp); pop_heap(first, bottom, last, comp); } template inline void make_maxmin_heap(It first, It last, Compare comp) { using namespace minmax_heap_detail; return minmax_heap_detail::make_heap(first, last, comp); } template inline void make_maxmin_heap(It first, It last) { using namespace minmax_heap_detail; return minmax_heap_detail::make_heap(first, last, std::less<>()); } template inline bool is_maxmin_heap(It first, It last, Compare comp) { using namespace minmax_heap_detail; return minmax_heap_detail::is_heap(first, last, comp); } template inline bool is_maxmin_heap(It first, It last) { using namespace minmax_heap_detail; return minmax_heap_detail::is_heap(first, last, std::less<>()); } template inline decltype(auto) bottom_maxmin_heap(It first, It last, Compare comp) { using namespace minmax_heap_detail; return *minmax_heap_detail::bottom_heap(first, last, comp); } template inline decltype(auto) bottom_maxmin_heap(It first, It last) { using namespace minmax_heap_detail; return *minmax_heap_detail::bottom_heap(first, last, std::less<>()); } }}}} // namespace boost::geometry::index::detail #endif // BOOST_GEOMETRY_INDEX_DETAIL_MAXMIN_HEAP_HPP