#pragma once #include "vector_type.hpp" #include #include template class priority_vector : public vector_type { const Comparator comp; public: explicit priority_vector(Comparator comp = std::less{}) : comp(comp), vector_type(0) {} void emplace_back(T val) { vector_type::emplace_back(val); std::push_heap(container, container + size, comp); } void pop_back() { std::pop_heap(container, container + size, comp); --size; } };