13 #ifndef STXXL_COMMON_IS_HEAP_HEADER
14 #define STXXL_COMMON_IS_HEAP_HEADER
22 template <
typename RandomAccessIterator,
typename StrictWeakOrdering>
24 RandomAccessIterator first, RandomAccessIterator last,
25 StrictWeakOrdering comp =
26 std::less<
typename std::iterator_traits<RandomAccessIterator>
29 typedef typename std::iterator_traits<RandomAccessIterator>
30 ::difference_type diff_type;
32 if (first == last)
return true;
34 RandomAccessIterator parent = first;
37 for (RandomAccessIterator child = first + 1; child != last; ++child, ++num)
39 if (comp(*parent, *child))
51 #endif // !STXXL_COMMON_IS_HEAP_HEADER
bool is_heap(RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp=std::less< typename std::iterator_traits< RandomAccessIterator >::value_type >())
#define STXXL_BEGIN_NAMESPACE
#define STXXL_END_NAMESPACE