front.pass.cpp 648 B

1234567891011121314151617181920212223242526272829
  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-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // <queue>
  9. // reference front();
  10. #include <queue>
  11. #include <cassert>
  12. #include "test_macros.h"
  13. int main(int, char**)
  14. {
  15. std::queue<int> q;
  16. assert(q.size() == 0);
  17. q.push(1);
  18. q.push(2);
  19. q.push(3);
  20. int& ir = q.front();
  21. assert(ir == 1);
  22. return 0;
  23. }