Esempio n. 1
0
    explicit PriorityQueue(const _Compare& __comp = _Compare(),
			   const _Sequence& __s = _Sequence(),
			   const _Map& __m = _Map())
    : c(__s), m(__m), comp(__comp) 
    { 
	make_heap(c.begin(), c.end(), comp); 
    }
Esempio n. 2
0
    PriorityQueue(_InputIterator __first, _InputIterator __last,
		  const _Compare& __comp = _Compare(), 
		  const _Sequence& __s = _Sequence(),
		  const _Map& __m = _Map()) 
    : c(__s), m(__m), comp(__comp) 
    {
	c.insert(c.end(), __first, __last);
	make_heap(c.begin(), c.end(), comp);
    }
Esempio n. 3
0
 iterator begin() { return c.begin(); }
Esempio n. 4
0
 const_iterator begin() const { return c.begin(); }
Esempio n. 5
0
 void make_heap()
 {
   std::make_heap(c.begin(), c.end(), static_cast<_Compare&>(*this));
 }
Esempio n. 6
0
 void pop()
 {
   std::pop_heap(c.begin(), c.end(), static_cast<_Compare&>(*this));
   c.pop_back();
 }
Esempio n. 7
0
 void push(const value_type& x)
 {
   c.push_back(x);
   std::push_heap(c.begin(), c.end(), static_cast<_Compare&>(*this));
 }
Esempio n. 8
0
    void pop() {
	pop_heap(c.begin(), c.end(), comp);
	c.pop_back();
    }
Esempio n. 9
0
    void push(const value_type& __x) {
	c.push_back(__x);
	push_heap(c.begin(), c.end(), comp);
    }