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 // <queue> 13 14 // void push(value_type&& v); 15 16 #include <queue> 17 #include <cassert> 18 19 #include "MoveOnly.h" 20 main()21int main() 22 { 23 std::queue<MoveOnly> q; 24 q.push(MoveOnly(1)); 25 assert(q.size() == 1); 26 assert(q.front() == MoveOnly(1)); 27 assert(q.back() == MoveOnly(1)); 28 q.push(MoveOnly(2)); 29 assert(q.size() == 2); 30 assert(q.front() == MoveOnly(1)); 31 assert(q.back() == MoveOnly(2)); 32 q.push(MoveOnly(3)); 33 assert(q.size() == 3); 34 assert(q.front() == MoveOnly(1)); 35 assert(q.back() == MoveOnly(3)); 36 } 37