Sorts the elements of the priority queue according to the strict partial ordering defined by the object of type Less passed to the priority queue. The heap property of the priority queue is invalidated by this operation. */
| 389 | operation. |
| 390 | */ |
| 391 | void sort() { |
| 392 | if (!m_container.empty()) { |
| 393 | for (size_type i = m_container.size() - 1; i > 0; --i) { |
| 394 | std::swap(m_container[i], m_container[0]); |
| 395 | m_marker(i, &m_container[i]); |
| 396 | m_marker(0, &m_container[0]); |
| 397 | heapify(0, i); |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | /// Clears the priority queue. |
| 403 | void clear() { m_container.clear(); } |