1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 // explicit vector(size_type n);
17 #include "test_macros.h"
18 #include "min_allocator.h"
19 #include "test_allocator.h"
23 test2(typename
C::size_type n
,
24 typename
C::allocator_type
const& a
= typename
C::allocator_type ())
26 #if TEST_STD_VER >= 14
28 LIBCPP_ASSERT(c
.__invariants());
29 assert(c
.size() == n
);
30 assert(c
.get_allocator() == a
);
31 for (typename
C::const_iterator i
= c
.cbegin(), e
= c
.cend(); i
!= e
; ++i
)
32 assert(*i
== typename
C::value_type());
41 test1(typename
C::size_type n
)
44 LIBCPP_ASSERT(c
.__invariants());
45 assert(c
.size() == n
);
46 assert(c
.get_allocator() == typename
C::allocator_type());
47 for (typename
C::const_iterator i
= c
.cbegin(), e
= c
.cend(); i
!= e
; ++i
)
48 assert(*i
== typename
C::value_type());
53 test(typename
C::size_type n
)
61 test
<std::vector
<bool> >(50);
62 #if TEST_STD_VER >= 11
63 test
<std::vector
<bool, min_allocator
<bool>> >(50);
64 test2
<std::vector
<bool, test_allocator
<bool>> >( 100, test_allocator
<bool>(23));