Fully qualify std::max_element, std::push_heap and std::pop_heap names.

This commit is contained in:
Zoltan Szabadka 2015-02-25 10:29:24 +01:00
parent c0d7498031
commit 5bc56a17ee
2 changed files with 3 additions and 3 deletions

View File

@ -342,7 +342,7 @@ void MoveToFront(std::vector<int>* v, int index) {
std::vector<int> MoveToFrontTransform(const std::vector<int>& v) {
if (v.empty()) return v;
std::vector<int> mtf(*max_element(v.begin(), v.end()) + 1);
std::vector<int> mtf(*std::max_element(v.begin(), v.end()) + 1);
for (int i = 0; i < mtf.size(); ++i) mtf[i] = i;
std::vector<int> result(v.size());
for (int i = 0; i < v.size(); ++i) {

View File

@ -102,7 +102,7 @@ void CompareAndPushToHeap(const HistogramType* out,
if (store_pair) {
p.cost_diff += p.cost_combo;
pairs->push_back(p);
push_heap(pairs->begin(), pairs->end(), HistogramPairComparator());
std::push_heap(pairs->begin(), pairs->end(), HistogramPairComparator());
}
}
@ -165,7 +165,7 @@ void HistogramCombine(HistogramType* out,
}
// Pop invalid pairs from the top of the heap.
while (!pairs.empty() && !pairs[0].valid) {
pop_heap(pairs.begin(), pairs.end(), HistogramPairComparator());
std::pop_heap(pairs.begin(), pairs.end(), HistogramPairComparator());
pairs.pop_back();
}
// Push new pairs formed with the combined histogram to the heap.