35 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// UNSUPPORTED: c++0310 11// <stack>12 13// void push(value_type&& v);14 15#include <stack>16#include <cassert>17 18#include "test_macros.h"19#include "MoveOnly.h"20 21int main(int, char**) {22 std::stack<MoveOnly> q;23 q.push(MoveOnly(1));24 assert(q.size() == 1);25 assert(q.top() == MoveOnly(1));26 q.push(MoveOnly(2));27 assert(q.size() == 2);28 assert(q.top() == MoveOnly(2));29 q.push(MoveOnly(3));30 assert(q.size() == 3);31 assert(q.top() == MoveOnly(3));32 33 return 0;34}35