blob: fc772f10dfc4359fbb3d1175c76916d309c4adec [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnantf5256e12010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00004//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00007//
8//===----------------------------------------------------------------------===//
9
10// <vector>
11// vector<bool>
12
13// vector(size_type n, const value_type& x);
14
15#include <vector>
16#include <cassert>
17
Marshall Clow061d0cc2013-11-26 20:58:02 +000018#include "min_allocator.h"
Howard Hinnant2c39cbe2013-06-27 19:35:32 +000019
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000020template <class C>
21void
22test(typename C::size_type n, const typename C::value_type& x)
23{
24 C c(n, x);
Dan Albert1d4a1ed2016-05-25 22:36:09 -070025 assert(c.__invariants());
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000026 assert(c.size() == n);
27 for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i)
28 assert(*i == x);
29}
30
31int main()
32{
33 test<std::vector<bool> >(50, 3);
Dan Albert1d4a1ed2016-05-25 22:36:09 -070034#if __cplusplus >= 201103L
Howard Hinnant2c39cbe2013-06-27 19:35:32 +000035 test<std::vector<bool, min_allocator<bool>> >(50, 3);
36#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000037}