brintos

brintos / llvm-project-archived public Read only

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