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