1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <queue> 11 12 // priority_queue& operator=(const priority_queue&) = default; 13 14 #include <queue> 15 #include <cassert> 16 17 template <class C> 18 C 19 make(int n) 20 { 21 C c; 22 for (int i = 0; i < n; ++i) 23 c.push_back(i); 24 return c; 25 } 26 27 int main() 28 { 29 std::vector<int> v = make<std::vector<int> >(5); 30 std::priority_queue<int, std::vector<int>, std::greater<int> > qo(std::greater<int>(), v); 31 std::priority_queue<int, std::vector<int>, std::greater<int> > q; 32 q = qo; 33 assert(q.size() == 5); 34 assert(q.top() == 0); 35 } 36