46 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <stack>10 11// template <class T, class Container>12// bool operator< (const stack<T, Container>& x,const stack<T, Container>& y);13//14// template <class T, class Container>15// bool operator> (const stack<T, Container>& x,const stack<T, Container>& y);16//17// template <class T, class Container>18// bool operator>=(const stack<T, Container>& x,const stack<T, Container>& y);19//20// template <class T, class Container>21// bool operator<=(const stack<T, Container>& x,const stack<T, Container>& y);22 23#include <stack>24#include <cassert>25 26#include "test_macros.h"27 28template <class C>29C make(int n) {30 C c;31 for (int i = 0; i < n; ++i)32 c.push(i);33 return c;34}35 36int main(int, char**) {37 std::stack<int> q1 = make<std::stack<int> >(5);38 std::stack<int> q2 = make<std::stack<int> >(10);39 assert(q1 < q2);40 assert(q2 > q1);41 assert(q1 <= q2);42 assert(q2 >= q1);43 44 return 0;45}46