copy.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
1//===----------------------------------------------------------------------===// 2// 3// ��������������������The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10// <list> 11 12// list(const list& c); 13 14#include <list> 15#include <cassert> 16#include "../../../DefaultOnly.h" 17#include "../../../test_allocator.h" 18 19int main() 20{ 21 { 22 std::list<int> l(3, 2); 23 std::list<int> l2 = l; 24 assert(l2 == l); 25 } 26 { 27 std::list<int, test_allocator<int> > l(3, 2, test_allocator<int>(5)); 28 std::list<int, test_allocator<int> > l2 = l; 29 assert(l2 == l); 30 assert(l2.get_allocator() == l.get_allocator()); 31 } 32#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE 33 { 34 std::list<int, other_allocator<int> > l(3, 2, other_allocator<int>(5)); 35 std::list<int, other_allocator<int> > l2 = l; 36 assert(l2 == l); 37 assert(l2.get_allocator() == other_allocator<int>(-2)); 38 } 39#endif 40} 41