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// vector<bool> 12 13// vector(size_type n, const value_type& x, const allocator_type& a); 14 15#include <vector> 16#include <cassert> 17 18#include "test_macros.h" 19#include "min_allocator.h" 20 21template <class C> 22void 23test(typename C::size_type n, const typename C::value_type& x, 24 const typename C::allocator_type& a) 25{ 26 C c(n, x, a); 27 LIBCPP_ASSERT(c.__invariants()); 28 assert(a == c.get_allocator()); 29 assert(c.size() == n); 30 for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i) 31 assert(*i == x); 32} 33 34int main() 35{ 36 test<std::vector<bool> >(50, true, std::allocator<bool>()); 37#if TEST_STD_VER >= 11 38 test<std::vector<bool, min_allocator<bool>> >(50, true, min_allocator<bool>()); 39#endif 40} 41