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 // <vector> 11 12 // vector& operator=(const vector& c); 13 14 #include <vector> 15 #include <cassert> 16 #include "test_allocator.h" 17 #include "min_allocator.h" 18 19 int main() 20 { 21 { 22 std::vector<int, test_allocator<int> > l(3, 2, test_allocator<int>(5)); 23 std::vector<int, test_allocator<int> > l2(l, test_allocator<int>(3)); 24 l2 = l; 25 assert(l2 == l); 26 assert(l2.get_allocator() == test_allocator<int>(3)); 27 } 28 { 29 std::vector<int, other_allocator<int> > l(3, 2, other_allocator<int>(5)); 30 std::vector<int, other_allocator<int> > l2(l, other_allocator<int>(3)); 31 l2 = l; 32 assert(l2 == l); 33 assert(l2.get_allocator() == other_allocator<int>(5)); 34 } 35 #if TEST_STD_VER >= 11 36 { 37 std::vector<int, min_allocator<int> > l(3, 2, min_allocator<int>()); 38 std::vector<int, min_allocator<int> > l2(l, min_allocator<int>()); 39 l2 = l; 40 assert(l2 == l); 41 assert(l2.get_allocator() == min_allocator<int>()); 42 } 43 #endif 44 } 45