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