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 // template <class T, class Container> 13 // bool operator==(const queue<T, Container>& x,const queue<T, Container>& y); 14 // 15 // template <class T, class Container> 16 // bool operator!=(const queue<T, Container>& x,const queue<T, Container>& y); 17 18 #include <queue> 19 #include <cassert> 20 21 template <class C> 22 C make(int n)23make(int n) 24 { 25 C c; 26 for (int i = 0; i < n; ++i) 27 c.push(i); 28 return c; 29 } 30 main()31int main() 32 { 33 std::queue<int> q1 = make<std::queue<int> >(5); 34 std::queue<int> q2 = make<std::queue<int> >(10); 35 std::queue<int> q1_save = q1; 36 std::queue<int> q2_save = q2; 37 assert(q1 == q1_save); 38 assert(q1 != q2); 39 assert(q2 == q2_save); 40 } 41