//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // explicit deque(size_type n); #include #include #include "../../../stack_allocator.h" #include "../../../DefaultOnly.h" template void test(unsigned n) { typedef std::deque C; typedef typename C::const_iterator const_iterator; assert(DefaultOnly::count == 0); { C d(n); assert(DefaultOnly::count == n); assert(d.size() == n); assert(distance(d.begin(), d.end()) == d.size()); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES for (const_iterator i = d.begin(), e = d.end(); i != e; ++i) assert(*i == T()); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } assert(DefaultOnly::count == 0); } int main() { test >(0); test >(1); test >(10); test >(1023); test >(1024); test >(1025); test >(2047); test >(2048); test >(2049); test >(4095); test >(4096); test >(4097); test >(4095); }