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 // <list> 11 12 // void push_back(value_type&& x); 13 14 #include <list> 15 #include <cassert> 16 17 #include "../../../MoveOnly.h" 18 #include "min_allocator.h" 19 20 int main() 21 { 22 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 23 { 24 std::list<MoveOnly> l1; 25 l1.push_back(MoveOnly(1)); 26 assert(l1.size() == 1); 27 assert(l1.front() == MoveOnly(1)); 28 l1.push_back(MoveOnly(2)); 29 assert(l1.size() == 2); 30 assert(l1.front() == MoveOnly(1)); 31 assert(l1.back() == MoveOnly(2)); 32 } 33 #if __cplusplus >= 201103L 34 { 35 std::list<MoveOnly, min_allocator<MoveOnly>> l1; 36 l1.push_back(MoveOnly(1)); 37 assert(l1.size() == 1); 38 assert(l1.front() == MoveOnly(1)); 39 l1.push_back(MoveOnly(2)); 40 assert(l1.size() == 2); 41 assert(l1.front() == MoveOnly(1)); 42 assert(l1.back() == MoveOnly(2)); 43 } 44 #endif 45 #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 46 } 47